diff options
| author | 2013-06-01 20:47:40 +0000 | |
|---|---|---|
| committer | 2013-06-01 20:47:40 +0000 | |
| commit | 7ff8e670fdcebc6357ff73a15e02d91577802ab6 (patch) | |
| tree | ed53d42fedbc32a6eba99a84f0405645632bc508 /lib/librthread/rthread_file.c | |
| parent | Filter out route messages we don't need and log kernel messages in (diff) | |
| download | wireguard-openbsd-7ff8e670fdcebc6357ff73a15e02d91577802ab6.tar.xz wireguard-openbsd-7ff8e670fdcebc6357ff73a15e02d91577802ab6.zip | |
cleanup and consolidate the spinlock_lock (what a name!) code.
it's now atomic_lock to better reflect its usage, and librthread now
features a new spinlock that's really a ticket lock.
thrlseep can handle both types of lock via a flag in the clock arg.
(temp back compat hack)
remove some old stuff that's accumulated along the way and no longer used.
some feedback from dlg, who is concerned with all things ticket lock.
(you need to boot a new kernel before installing librthread)
Diffstat (limited to 'lib/librthread/rthread_file.c')
| -rw-r--r-- | lib/librthread/rthread_file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/librthread/rthread_file.c b/lib/librthread/rthread_file.c index 28bad52d0c2..06afc366015 100644 --- a/lib/librthread/rthread_file.c +++ b/lib/librthread/rthread_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_file.c,v 1.4 2012/01/17 02:34:18 guenther Exp $ */ +/* $OpenBSD: rthread_file.c,v 1.5 2013/06/01 20:47:40 tedu Exp $ */ /* * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>. * All rights reserved. @@ -86,7 +86,7 @@ static struct static_file_lock { } flh[NUM_HEADS]; /* Lock for accesses to the hash table: */ -static _spinlock_lock_t hash_lock = _SPINLOCK_UNLOCKED; +static struct _spinlock hash_lock = _SPINLOCK_UNLOCKED; /* * Find a lock structure for a FILE, return NULL if the file is @@ -204,7 +204,7 @@ void */ TAILQ_INSERT_TAIL(&p->lockers,self,waiting); while (p->owner != self) { - __thrsleep(self, 0, NULL, &hash_lock, NULL); + __thrsleep(self, 0 | 0x8, NULL, &hash_lock.ready, NULL); _spinlock(&hash_lock); } } |
