When creating a pthread in the suspended state their were two

problems: (1) The wrong flag was being checked for in the attribute
	  (2) The pthread's state was not being set to indicate it was
	      suspended.

Noticed by: Igor Sysoev <is@rambler-co.ru>
This commit is contained in:
mtm 2003-12-15 09:35:02 +00:00
parent 79971791cf
commit 0593ac4cbb

View File

@ -185,10 +185,12 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
* Create the thread.
*
*/
if (pattr->suspend == PTHREAD_FLAGS_SUSPENDED)
if (pattr->suspend == PTHREAD_CREATE_SUSPENDED) {
new_thread->flags |= PTHREAD_FLAGS_SUSPENDED;
flags = THR_SUSPENDED;
else
} else {
flags = 0;
}
ret = thr_create(&new_thread->ctx, &new_thread->thr_id, flags);