(empth_create): LWP yields, and it's the reference implementation.

Document and fix the others.
This commit is contained in:
Markus Armbruster 2006-03-25 07:49:37 +00:00
parent 8054aafb9a
commit ba11aaaa36
3 changed files with 3 additions and 0 deletions

View file

@ -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 * UD is the value to pass to ENTRY. It is also assigned to the
* context variable defined with empth_init() whenever the thread gets * context variable defined with empth_init() whenever the thread gets
* scheduled. * scheduled.
* Yield the processor.
* Return the thread, or NULL on error. * Return the thread, or NULL on error.
*/ */
empth_t *empth_create(int prio, void (*entry)(void *), empth_t *empth_create(int prio, void (*entry)(void *),

View file

@ -463,6 +463,7 @@ empth_create(int prio, void (*entry)(void *), int size, int flags,
} }
loc_debug("new thread id is %ld", pThread->ulThreadID); loc_debug("new thread id is %ld", pThread->ulThreadID);
empth_yield();
return pThread; return pThread;
bad: bad:

View file

@ -236,6 +236,7 @@ empth_create(int prio, void (*entry)(void *), int size, int flags,
goto bad; goto bad;
} }
empth_status("new thread id is %ld", (long)t); empth_status("new thread id is %ld", (long)t);
empth_yield();
return ctx; return ctx;
bad: bad: