Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Diff of /pthread_spin_destroy.c [eb28d5] .. [6e3ac5] Maximize Restore

  Switch to side-by-side view

--- a/pthread_spin_destroy.c
+++ b/pthread_spin_destroy.c
@@ -81,7 +81,9 @@
       /*
        * See notes in ptw32_spinlock_check_need_init() above also.
        */
-      EnterCriticalSection (&ptw32_spinlock_test_init_lock);
+      ptw32_mcs_local_node_t node;
+
+      ptw32_mcs_lock_acquire(&ptw32_spinlock_test_init_lock, &node);
 
       /*
        * Check again.
@@ -105,7 +107,7 @@
 	  result = EBUSY;
 	}
 
-      LeaveCriticalSection (&ptw32_spinlock_test_init_lock);
+       ptw32_mcs_lock_release(&node);
     }
 
   return (result);