Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /pthread_mutex_unlock.c [26ed1e] .. [3f334b] Maximize Restore

  Switch to side-by-side view

--- a/pthread_mutex_unlock.c
+++ b/pthread_mutex_unlock.c
@@ -66,8 +66,8 @@
 	    {
 	      LONG idx;
 
-	      idx = (LONG) PTW32_INTERLOCKED_EXCHANGE ((LPLONG) &mx->lock_idx,
-						       (LONG) 0);
+	      idx = (LONG)(size_t) PTW32_INTERLOCKED_EXCHANGE ((PTW32_INTERLOCKED_PTR)&mx->lock_idx,
+						       (PTW32_INTERLOCKED_VALUE)0);
 	      if (idx != 0)
 	        {
 	          if (idx < 0)
@@ -91,8 +91,8 @@
 		    {
 		      mx->ownerThread.p = NULL;
 
-		      if ((LONG) PTW32_INTERLOCKED_EXCHANGE ((LPLONG) &mx->lock_idx,
-							     (LONG) 0) < 0)
+		      if ((LONG)(size_t) PTW32_INTERLOCKED_EXCHANGE ((PTW32_INTERLOCKED_PTR)&mx->lock_idx,
+							     (PTW32_INTERLOCKED_VALUE)0) < 0)
 		        {
 		          /* Someone may be waiting on that mutex */
 		          if (SetEvent (mx->event) == 0)
@@ -120,15 +120,15 @@
            */
           if (pthread_equal (mx->ownerThread, self))
             {
-              PTW32_INTERLOCKED_COMPARE_EXCHANGE((LPLONG) &mx->robustNode->stateInconsistent,
-                                                 (LONG)PTW32_ROBUST_NOTRECOVERABLE,
-                                                 (LONG)PTW32_ROBUST_INCONSISTENT);
+              PTW32_INTERLOCKED_COMPARE_EXCHANGE((PTW32_INTERLOCKED_PTR) &mx->robustNode->stateInconsistent,
+                                                 (PTW32_INTERLOCKED_VALUE)PTW32_ROBUST_NOTRECOVERABLE,
+                                                 (PTW32_INTERLOCKED_VALUE)PTW32_ROBUST_INCONSISTENT);
               if (PTHREAD_MUTEX_NORMAL == kind)
                 {
                   ptw32_robust_mutex_remove(mutex, NULL);
 
-                  if ((LONG) PTW32_INTERLOCKED_EXCHANGE((LPLONG) &mx->lock_idx,
-                                                          (LONG) 0) < 0)
+                  if ((LONG)(size_t) PTW32_INTERLOCKED_EXCHANGE((PTW32_INTERLOCKED_PTR) &mx->lock_idx,
+                                                          (PTW32_INTERLOCKED_VALUE) 0) < 0)
                     {
                       /*
                        * Someone may be waiting on that mutex.
@@ -146,8 +146,8 @@
                     {
                       ptw32_robust_mutex_remove(mutex, NULL);
 
-                      if ((LONG) PTW32_INTERLOCKED_EXCHANGE((LPLONG) &mx->lock_idx,
-                                                            (LONG) 0) < 0)
+                      if ((LONG)(size_t) PTW32_INTERLOCKED_EXCHANGE((PTW32_INTERLOCKED_PTR) &mx->lock_idx,
+                                                            (PTW32_INTERLOCKED_VALUE) 0) < 0)
                         {
                           /*
                            * Someone may be waiting on that mutex.