Check RUBY_THREAD_TIMESLICE value
This commit is contained in:
parent
c07fb79150
commit
57f6329ba7
Notes:
git
2024-12-18 02:13:09 +00:00
8
thread.c
8
thread.c
@ -5511,7 +5511,13 @@ Init_Thread(void)
|
||||
const char * ptr = getenv("RUBY_THREAD_TIMESLICE");
|
||||
|
||||
if (ptr) {
|
||||
thread_default_quantum_ms = (uint32_t)strtol(ptr, NULL, 0);
|
||||
long quantum = strtol(ptr, NULL, 0);
|
||||
if (quantum > 0 && quantum <= UINT32_MAX) {
|
||||
thread_default_quantum_ms = (uint32_t)quantum;
|
||||
}
|
||||
else if (0) {
|
||||
fprintf(stderr, "Ignored RUBY_THREAD_TIMESLICE=%s\n", ptr);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user