diff options
author | mtm <mtm@FreeBSD.org> | 2003-12-15 09:35:02 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2003-12-15 09:35:02 +0000 |
commit | 0593ac4cbb15c2a87a2c9c9ecd713118d935895a (patch) | |
tree | 4e19dee37bc56be186a7b32befee0aae84e90125 | |
parent | 79971791cf9ec9c2f6f14171884d021b94f7de06 (diff) | |
download | FreeBSD-src-0593ac4cbb15c2a87a2c9c9ecd713118d935895a.zip FreeBSD-src-0593ac4cbb15c2a87a2c9c9ecd713118d935895a.tar.gz |
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>
-rw-r--r-- | lib/libthr/thread/thr_create.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c index 0b08562..41019ad 100644 --- a/lib/libthr/thread/thr_create.c +++ b/lib/libthr/thread/thr_create.c @@ -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); |