diff options
author | raf <none@none> | 2007-06-29 13:31:58 -0700 |
---|---|---|
committer | raf <none@none> | 2007-06-29 13:31:58 -0700 |
commit | 883492d5a933deb34cd27521e7f2756773cd27af (patch) | |
tree | 0c80cc8bc2b91d1882235f25cf28ef8ed0e4e6e3 /usr/src/lib/libc/port/threads/thr.c | |
parent | ec4858345aa8c9134ae2563545c54823cd78b5c8 (diff) | |
download | illumos-gate-883492d5a933deb34cd27521e7f2756773cd27af.tar.gz |
PSARC 2007/285 robust locks revisited
6296770 process robust mutexes should be much faster
Diffstat (limited to 'usr/src/lib/libc/port/threads/thr.c')
-rw-r--r-- | usr/src/lib/libc/port/threads/thr.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/usr/src/lib/libc/port/threads/thr.c b/usr/src/lib/libc/port/threads/thr.c index affa5297eb..6df0608e1c 100644 --- a/usr/src/lib/libc/port/threads/thr.c +++ b/usr/src/lib/libc/port/threads/thr.c @@ -117,6 +117,7 @@ uberdata_t __uberdata = { NULL, /* ulwp_replace_free */ NULL, /* ulwp_replace_last */ NULL, /* atforklist */ + NULL, /* robustlocks */ NULL, /* __tdb_bootstrap */ { /* tdb */ NULL, /* tdb_sync_addr_hash */ @@ -798,8 +799,9 @@ _thrp_exit() } lmutex_unlock(&udp->link_lock); - tsd_exit(); /* deallocate thread-specific data */ - tls_exit(); /* deallocate thread-local storage */ + tsd_exit(); /* deallocate thread-specific data */ + tls_exit(); /* deallocate thread-local storage */ + heldlock_exit(); /* deal with left-over held locks */ /* block all signals to finish exiting */ block_all_signals(self); @@ -1564,6 +1566,7 @@ finish_init() udp->hash_mask = HASHTBLSZ - 1; for (i = 0; i < HASHTBLSZ; i++, htp++) { + htp->hash_lock.mutex_flag = LOCK_INITED; htp->hash_lock.mutex_magic = MUTEX_MAGIC; htp->hash_cond.cond_magic = COND_MAGIC; } @@ -1610,6 +1613,7 @@ postfork1_child() { ulwp_t *self = curthread; uberdata_t *udp = self->ul_uberdata; + mutex_t *mp; ulwp_t *next; ulwp_t *ulwp; int i; @@ -1629,8 +1633,11 @@ postfork1_child() if (udp->queue_head) { (void) _private_memset(udp->queue_head, 0, 2 * QHASHSIZE * sizeof (queue_head_t)); - for (i = 0; i < 2 * QHASHSIZE; i++) - udp->queue_head[i].qh_lock.mutex_magic = MUTEX_MAGIC; + for (i = 0; i < 2 * QHASHSIZE; i++) { + mp = &udp->queue_head[i].qh_lock; + mp->mutex_flag = LOCK_INITED; + mp->mutex_magic = MUTEX_MAGIC; + } } /* @@ -1650,6 +1657,7 @@ postfork1_child() tsd_free(ulwp); tls_free(ulwp); rwl_free(ulwp); + heldlock_free(ulwp); ulwp_free(ulwp); } self->ul_forw = self->ul_back = udp->all_lwps = self; |