Fix usleep for small values
This commit is contained in:
parent
4204087bd1
commit
e0c392c16e
@ -331,6 +331,8 @@ int threadUsleep(unsigned long usec)
|
|||||||
current->state = SLEEPING;
|
current->state = SLEEPING;
|
||||||
current->sleepHaveTimeouted = 0;
|
current->sleepHaveTimeouted = 0;
|
||||||
current->jiffiesSleeping = usecs_to_jiffies(usec);
|
current->jiffiesSleeping = usecs_to_jiffies(usec);
|
||||||
|
if (!current->jiffiesSleeping) // sleep at least 1 jiffies
|
||||||
|
current->jiffiesSleeping = 1;
|
||||||
next = threadSelectNext();
|
next = threadSelectNext();
|
||||||
|
|
||||||
assert(next != current);
|
assert(next != current);
|
||||||
|
@ -124,6 +124,7 @@ int func_munmap()
|
|||||||
static void *print_hello(void *arg) {
|
static void *print_hello(void *arg) {
|
||||||
(void)arg;
|
(void)arg;
|
||||||
printf("Hello World from thread %lu\n", gettid());
|
printf("Hello World from thread %lu\n", gettid());
|
||||||
|
usleep(100);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user