diff options
author | mtm <mtm@FreeBSD.org> | 2004-04-24 09:38:41 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2004-04-24 09:38:41 +0000 |
commit | 45d8ed51628d5f95a5a43316b8eb22fee81aebb3 (patch) | |
tree | e85536d30ceb14da0502ffb16970962554cc6ae3 /lib/libthr | |
parent | 648e15957e6a159991b336b5c6bd276f05a23ab1 (diff) | |
download | FreeBSD-src-45d8ed51628d5f95a5a43316b8eb22fee81aebb3.zip FreeBSD-src-45d8ed51628d5f95a5a43316b8eb22fee81aebb3.tar.gz |
Unconditionaly initialize any spin lock passed to pthread_spin_init(). While
makeing sure the spinlock isn't already in use might be a nice feature to
have in theory, it's hard to implement in practice since the passed in
pointer may not be NULL, but still be an invalid value (i.e. 1..2..3.. etc).
Diffstat (limited to 'lib/libthr')
-rw-r--r-- | lib/libthr/thread/thr_spinlock.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_spinlock.c b/lib/libthr/thread/thr_spinlock.c index 60e9522..d590ad5 100644 --- a/lib/libthr/thread/thr_spinlock.c +++ b/lib/libthr/thread/thr_spinlock.c @@ -80,10 +80,6 @@ _pthread_spin_init(pthread_spinlock_t *lock, int pshared) { struct pthread_spinlock *s; - if (*lock != NULL) { - if ((*lock)->s_magic == THR_SPIN_MAGIC) - return (EBUSY); - } s = (struct pthread_spinlock *)malloc(sizeof(struct pthread_spinlock)); if (s == NULL) return (ENOMEM); |