From 414f4bd7e70d94025576d9264c86da63c506f6ca Mon Sep 17 00:00:00 2001 From: rpj Date: Wed, 13 Aug 2003 15:10:53 +0000 Subject: Bug fixes plus adaptation to current MinGW/MsysDTK environment. Changes to tests/benchmarks. --- pthread_spin_lock.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pthread_spin_lock.c') diff --git a/pthread_spin_lock.c b/pthread_spin_lock.c index d3355d1..f9210f1 100644 --- a/pthread_spin_lock.c +++ b/pthread_spin_lock.c @@ -38,14 +38,16 @@ #include "implement.h" -/* - * NOTE: For speed, these routines don't check if "lock" is valid. - */ int pthread_spin_lock(pthread_spinlock_t *lock) { register pthread_spinlock_t s; + if (NULL == lock || NULL == *lock) + { + return(EINVAL); + } + if (*lock == PTHREAD_SPINLOCK_INITIALIZER) { int result; -- cgit v1.2.3