From: Markus Armbruster Date: Sat, 25 Mar 2006 07:49:37 +0000 (+0000) Subject: (empth_create): LWP yields, and it's the reference implementation. X-Git-Tag: v4.3.1~81 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=ba11aaaa36ba55838bb68aa27018b739075a086a (empth_create): LWP yields, and it's the reference implementation. Document and fix the others. --- diff --git a/include/empthread.h b/include/empthread.h index c739eff69..f40d4782b 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 cdd9bc77f..48e433b50 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 a1c8ceac5..a0aa4a312 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: