summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_create.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-02-28 17:52:33 +0000
committerkib <kib@FreeBSD.org>2016-02-28 17:52:33 +0000
commite76eb4255b957aa73f6228dd8d525d1946e3707d (patch)
tree93354adb0a612a635964c8498072087760a0f93b /lib/libthr/thread/thr_create.c
parent800b1f3198ded0c65c024ea0cef1f44d4bc59fed (diff)
downloadFreeBSD-src-e76eb4255b957aa73f6228dd8d525d1946e3707d.zip
FreeBSD-src-e76eb4255b957aa73f6228dd8d525d1946e3707d.tar.gz
Implement process-shared locks support for libthr.so.3, without
breaking the ABI. Special value is stored in the lock pointer to indicate shared lock, and offline page in the shared memory is allocated to store the actual lock. Reviewed by: vangyzen (previous version) Discussed with: deischen, emaste, jhb, rwatson, Martin Simmons <martin@lispworks.com> Tested by: pho Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'lib/libthr/thread/thr_create.c')
-rw-r--r--lib/libthr/thread/thr_create.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c
index 701a1bd..81a95da 100644
--- a/lib/libthr/thread/thr_create.c
+++ b/lib/libthr/thread/thr_create.c
@@ -56,12 +56,12 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
struct thr_param param;
struct sched_param sched_param;
struct rtprio rtp;
- int ret = 0, locked, create_suspended;
sigset_t set, oset;
- cpuset_t *cpusetp = NULL;
- int cpusetsize = 0;
- int old_stack_prot;
+ cpuset_t *cpusetp;
+ int i, cpusetsize, create_suspended, locked, old_stack_prot, ret;
+ cpusetp = NULL;
+ ret = cpusetsize = 0;
_thr_check_init();
/*
@@ -118,8 +118,8 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
new_thread->cancel_enable = 1;
new_thread->cancel_async = 0;
/* Initialize the mutex queue: */
- TAILQ_INIT(&new_thread->mutexq);
- TAILQ_INIT(&new_thread->pp_mutexq);
+ for (i = 0; i < TMQ_NITEMS; i++)
+ TAILQ_INIT(&new_thread->mq[i]);
/* Initialise hooks in the thread structure: */
if (new_thread->attr.suspend == THR_CREATE_SUSPENDED) {
OpenPOWER on IntegriCloud