diff options
Diffstat (limited to 'pthread_spin_unlock.c')
-rw-r--r-- | pthread_spin_unlock.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pthread_spin_unlock.c b/pthread_spin_unlock.c index 30c11d4..7b77395 100644 --- a/pthread_spin_unlock.c +++ b/pthread_spin_unlock.c @@ -38,13 +38,17 @@ #include "implement.h" -/* - * NOTE: For speed, these routines don't check if "lock" is valid. - */ int pthread_spin_unlock(pthread_spinlock_t *lock) { - register pthread_spinlock_t s = *lock; + register pthread_spinlock_t s; + + if (NULL == lock || NULL == *lock) + { + return(EINVAL); + } + + s = *lock; if (s == PTHREAD_SPINLOCK_INITIALIZER) { |