diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2012-03-02 08:07:44 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2012-03-02 08:07:44 +0000 |
commit | 8565f964d945531fadce63b31b74b3988b06cf24 (patch) | |
tree | 1ffe64bb26a3a2da87911ed9ea5bb79713abf965 /lib | |
parent | 217511b40b68743a410d94fec4e865144bef57b4 (diff) |
_SPINLOCK_UNLOCKED isn't zero everywhere (*cough*hppa*cough*), so
sem_init() can't assume that calloc will leave the embedded spinlock
in the unlocked state
ok miod@ otto@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/librthread/rthread_sem.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/librthread/rthread_sem.c b/lib/librthread/rthread_sem.c index 66c22af4b9a..3a410b62155 100644 --- a/lib/librthread/rthread_sem.c +++ b/lib/librthread/rthread_sem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_sem.c,v 1.4 2012/01/17 02:34:18 guenther Exp $ */ +/* $OpenBSD: rthread_sem.c,v 1.5 2012/03/02 08:07:43 guenther Exp $ */ /* * Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org> * All Rights Reserved. @@ -92,6 +92,7 @@ sem_init(sem_t *semp, int pshared, unsigned int value) errno = ENOSPC; return (-1); } + sem->lock = _SPINLOCK_UNLOCKED; sem->value = value; *semp = sem; |