From 771465fed0cf50ee2dd790723245fc091699c324 Mon Sep 17 00:00:00 2001 From: rpj Date: Mon, 17 May 2004 01:38:02 +0000 Subject: re-indentation, bug fixes, hooks for pre-emptive async cancelation --- pthread_spin_unlock.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'pthread_spin_unlock.c') diff --git a/pthread_spin_unlock.c b/pthread_spin_unlock.c index 42fb4a6..7b40f7f 100644 --- a/pthread_spin_unlock.c +++ b/pthread_spin_unlock.c @@ -39,13 +39,13 @@ int -pthread_spin_unlock(pthread_spinlock_t *lock) +pthread_spin_unlock (pthread_spinlock_t * lock) { register pthread_spinlock_t s; if (NULL == lock || NULL == *lock) { - return(EINVAL); + return (EINVAL); } s = *lock; @@ -55,13 +55,20 @@ pthread_spin_unlock(pthread_spinlock_t *lock) return EPERM; } - switch ((long) ptw32_interlocked_compare_exchange((PTW32_INTERLOCKED_LPLONG) &(s->interlock), - (PTW32_INTERLOCKED_LONG) PTW32_SPIN_UNLOCKED, - (PTW32_INTERLOCKED_LONG) PTW32_SPIN_LOCKED )) + switch ((long) + ptw32_interlocked_compare_exchange ((PTW32_INTERLOCKED_LPLONG) & + (s->interlock), + (PTW32_INTERLOCKED_LONG) + PTW32_SPIN_UNLOCKED, + (PTW32_INTERLOCKED_LONG) + PTW32_SPIN_LOCKED)) { - case PTW32_SPIN_LOCKED: return 0; - case PTW32_SPIN_UNLOCKED: return EPERM; - case PTW32_SPIN_USE_MUTEX: return pthread_mutex_unlock(&(s->u.mutex)); + case PTW32_SPIN_LOCKED: + return 0; + case PTW32_SPIN_UNLOCKED: + return EPERM; + case PTW32_SPIN_USE_MUTEX: + return pthread_mutex_unlock (&(s->u.mutex)); } return EINVAL; -- cgit v1.2.3