diff options
author | Michal Mazurek <akfaew@cvs.openbsd.org> | 2016-09-03 16:44:21 +0000 |
---|---|---|
committer | Michal Mazurek <akfaew@cvs.openbsd.org> | 2016-09-03 16:44:21 +0000 |
commit | 46036a85f87b62d5e1118f617afac606e3bf039c (patch) | |
tree | 9eb5c2aeca4f8bd9b76276eeb0581c130abf1d03 /lib/librthread | |
parent | 64fadef64490c07991c2f27641963bac0db4f7c7 (diff) |
Remove _USING_TICKETS, it's defined as 0. No functional change.
ok tedu@ mpi@
Diffstat (limited to 'lib/librthread')
-rw-r--r-- | lib/librthread/rthread.c | 5 | ||||
-rw-r--r-- | lib/librthread/rthread.h | 3 | ||||
-rw-r--r-- | lib/librthread/rthread_file.c | 5 | ||||
-rw-r--r-- | lib/librthread/rthread_rwlock.c | 9 | ||||
-rw-r--r-- | lib/librthread/rthread_sem.c | 7 | ||||
-rw-r--r-- | lib/librthread/rthread_sync.c | 15 |
6 files changed, 19 insertions, 25 deletions
diff --git a/lib/librthread/rthread.c b/lib/librthread/rthread.c index 399f42cb48d..8995c6b7496 100644 --- a/lib/librthread/rthread.c +++ b/lib/librthread/rthread.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread.c,v 1.92 2016/09/01 10:41:02 otto Exp $ */ +/* $OpenBSD: rthread.c,v 1.93 2016/09/03 16:44:20 akfaew Exp $ */ /* * Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org> * All Rights Reserved. @@ -658,8 +658,7 @@ _rthread_dl_lock(int what) } else if (owner != self) { TAILQ_INSERT_TAIL(&lockers, self, waiting); while (owner != self) { - __thrsleep(self, 0 | _USING_TICKETS, NULL, - &lock.ticket, NULL); + __thrsleep(self, 0, NULL, &lock.ticket, NULL); _spinlock(&lock); } } diff --git a/lib/librthread/rthread.h b/lib/librthread/rthread.h index 10973208184..df719f681e7 100644 --- a/lib/librthread/rthread.h +++ b/lib/librthread/rthread.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread.h,v 1.58 2016/05/07 19:05:22 guenther Exp $ */ +/* $OpenBSD: rthread.h,v 1.59 2016/09/03 16:44:20 akfaew Exp $ */ /* * Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org> * All Rights Reserved. @@ -37,7 +37,6 @@ #define RTHREAD_STACK_SIZE_DEF (256 * 1024) #endif -#define _USING_TICKETS 0 /* * tickets don't work yet? (or seem much slower, with lots of system time) * until then, keep the struct around to avoid excessive changes going diff --git a/lib/librthread/rthread_file.c b/lib/librthread/rthread_file.c index e9572ea117b..25d67ce659d 100644 --- a/lib/librthread/rthread_file.c +++ b/lib/librthread/rthread_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_file.c,v 1.8 2016/05/07 19:05:22 guenther Exp $ */ +/* $OpenBSD: rthread_file.c,v 1.9 2016/09/03 16:44:20 akfaew Exp $ */ /* * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>. * All rights reserved. @@ -205,8 +205,7 @@ _thread_flockfile(FILE * fp) */ TAILQ_INSERT_TAIL(&p->lockers,self,waiting); while (p->owner != self) { - __thrsleep(self, 0 | _USING_TICKETS, NULL, - &hash_lock.ticket, NULL); + __thrsleep(self, 0, NULL, &hash_lock.ticket, NULL); _spinlock(&hash_lock); } } diff --git a/lib/librthread/rthread_rwlock.c b/lib/librthread/rthread_rwlock.c index 007196bbbb6..cb424b19a6d 100644 --- a/lib/librthread/rthread_rwlock.c +++ b/lib/librthread/rthread_rwlock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_rwlock.c,v 1.6 2016/04/02 19:56:53 guenther Exp $ */ +/* $OpenBSD: rthread_rwlock.c,v 1.7 2016/09/03 16:44:20 akfaew Exp $ */ /* * Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org> * Copyright (c) 2012 Philip Guenther <guenther@openbsd.org> @@ -117,8 +117,8 @@ _rthread_rwlock_rdlock(pthread_rwlock_t *lockp, const struct timespec *abstime, error = EDEADLK; else { do { - if (__thrsleep(lock, CLOCK_REALTIME | _USING_TICKETS, - abstime, &lock->lock.ticket, NULL) == EWOULDBLOCK) + if (__thrsleep(lock, CLOCK_REALTIME, abstime, + &lock->lock.ticket, NULL) == EWOULDBLOCK) return (ETIMEDOUT); _spinlock(&lock->lock); } while (lock->owner != NULL || !TAILQ_EMPTY(&lock->writers)); @@ -180,8 +180,7 @@ _rthread_rwlock_wrlock(pthread_rwlock_t *lockp, const struct timespec *abstime, /* gotta block */ TAILQ_INSERT_TAIL(&lock->writers, thread, waiting); do { - do_wait = __thrsleep(thread, CLOCK_REALTIME | - _USING_TICKETS, abstime, + do_wait = __thrsleep(thread, CLOCK_REALTIME, abstime, &lock->lock.ticket, NULL) != EWOULDBLOCK; _spinlock(&lock->lock); } while (lock->owner != thread && do_wait); diff --git a/lib/librthread/rthread_sem.c b/lib/librthread/rthread_sem.c index dcf51afc26c..60c661c34d8 100644 --- a/lib/librthread/rthread_sem.c +++ b/lib/librthread/rthread_sem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_sem.c,v 1.23 2016/05/07 19:05:22 guenther Exp $ */ +/* $OpenBSD: rthread_sem.c,v 1.24 2016/09/03 16:44:20 akfaew Exp $ */ /* * Copyright (c) 2004,2005,2013 Ted Unangst <tedu@openbsd.org> * All Rights Reserved. @@ -71,9 +71,8 @@ _sem_wait(sem_t sem, int tryonly, const struct timespec *abstime, } else { sem->waitcount++; do { - r = __thrsleep(ident, CLOCK_REALTIME | - _USING_TICKETS, abstime, &sem->lock.ticket, - delayed_cancel); + r = __thrsleep(ident, CLOCK_REALTIME, abstime, + &sem->lock.ticket, delayed_cancel); _spinlock(&sem->lock); /* ignore interruptions other than cancelation */ if (r == EINTR && (delayed_cancel == NULL || diff --git a/lib/librthread/rthread_sync.c b/lib/librthread/rthread_sync.c index 7deb9fbea1a..7abf0709d1f 100644 --- a/lib/librthread/rthread_sync.c +++ b/lib/librthread/rthread_sync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_sync.c,v 1.42 2016/05/07 19:05:22 guenther Exp $ */ +/* $OpenBSD: rthread_sync.c,v 1.43 2016/09/03 16:44:20 akfaew Exp $ */ /* * Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org> * Copyright (c) 2012 Philip Guenther <guenther@openbsd.org> @@ -130,8 +130,7 @@ _rthread_mutex_lock(pthread_mutex_t *mutexp, int trywait, abort(); /* self-deadlock, possibly until timeout */ - while (__thrsleep(self, CLOCK_REALTIME | - _USING_TICKETS, abstime, + while (__thrsleep(self, CLOCK_REALTIME, abstime, &mutex->lock.ticket, NULL) != EWOULDBLOCK) _spinlock(&mutex->lock); return (ETIMEDOUT); @@ -148,8 +147,8 @@ _rthread_mutex_lock(pthread_mutex_t *mutexp, int trywait, /* add to the wait queue and block until at the head */ TAILQ_INSERT_TAIL(&mutex->lockers, self, waiting); while (mutex->owner != self) { - ret = __thrsleep(self, CLOCK_REALTIME | _USING_TICKETS, - abstime, &mutex->lock.ticket, NULL); + ret = __thrsleep(self, CLOCK_REALTIME, abstime, + &mutex->lock.ticket, NULL); _spinlock(&mutex->lock); assert(mutex->owner != NULL); if (ret == EWOULDBLOCK) { @@ -360,7 +359,7 @@ pthread_cond_timedwait(pthread_cond_t *condp, pthread_mutex_t *mutexp, /* wait until we're the owner of the mutex again */ while (mutex->owner != self) { - error = __thrsleep(self, cond->clock | _USING_TICKETS, abstime, + error = __thrsleep(self, cond->clock, abstime, &mutex->lock.ticket, &self->delayed_cancel); /* @@ -510,8 +509,8 @@ pthread_cond_wait(pthread_cond_t *condp, pthread_mutex_t *mutexp) /* wait until we're the owner of the mutex again */ while (mutex->owner != self) { - error = __thrsleep(self, 0 | _USING_TICKETS, NULL, - &mutex->lock.ticket, &self->delayed_cancel); + error = __thrsleep(self, 0, NULL, &mutex->lock.ticket, + &self->delayed_cancel); /* * If we took a normal signal (not from |