diff --git a/include/empthread.h b/include/empthread.h index c739eff6..f40d4782 100644 --- a/include/empthread.h +++ b/include/empthread.h @@ -131,6 +131,7 @@ int empth_init(void **ctx, int flags); * UD is the value to pass to ENTRY. It is also assigned to the * context variable defined with empth_init() whenever the thread gets * scheduled. + * Yield the processor. * Return the thread, or NULL on error. */ empth_t *empth_create(int prio, void (*entry)(void *), diff --git a/src/lib/empthread/ntthread.c b/src/lib/empthread/ntthread.c index cdd9bc77..48e433b5 100644 --- a/src/lib/empthread/ntthread.c +++ b/src/lib/empthread/ntthread.c @@ -463,6 +463,7 @@ empth_create(int prio, void (*entry)(void *), int size, int flags, } loc_debug("new thread id is %ld", pThread->ulThreadID); + empth_yield(); return pThread; bad: diff --git a/src/lib/empthread/pthread.c b/src/lib/empthread/pthread.c index a1c8ceac..a0aa4a31 100644 --- a/src/lib/empthread/pthread.c +++ b/src/lib/empthread/pthread.c @@ -236,6 +236,7 @@ empth_create(int prio, void (*entry)(void *), int size, int flags, goto bad; } empth_status("new thread id is %ld", (long)t); + empth_yield(); return ctx; bad: