/[pcsx2_0.9.7]/trunk/3rdparty/w32pthreads/pthread_mutex_timedlock.c
ViewVC logotype

Diff of /trunk/3rdparty/w32pthreads/pthread_mutex_timedlock.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/3rdparty/w32pthreads/pthread_mutex_timedlock.c	2010/12/23 11:48:33	279
+++ trunk/3rdparty/w32pthreads/pthread_mutex_timedlock.c	2010/12/23 12:02:12	280
@@ -133,13 +133,9 @@
 
   if (mx->kind == PTHREAD_MUTEX_NORMAL)
     {
-      if ((LONG) PTW32_INTERLOCKED_EXCHANGE(
-		   (LPLONG) &mx->lock_idx,
-		   (LONG) 1) != 0)
+		if (_InterlockedExchange(&mx->lock_idx, 1) != 0)
 	{
-          while ((LONG) PTW32_INTERLOCKED_EXCHANGE(
-                          (LPLONG) &mx->lock_idx,
-			  (LONG) -1) != 0)
+          while (_InterlockedExchange(&mx->lock_idx, -1) != 0)
             {
 	      if (0 != (result = ptw32_timed_eventwait (mx->event, abstime)))
 		{
@@ -152,10 +148,7 @@
     {
       pthread_t self = pthread_self();
 
-      if ((PTW32_INTERLOCKED_LONG) PTW32_INTERLOCKED_COMPARE_EXCHANGE(
-                   (PTW32_INTERLOCKED_LPLONG) &mx->lock_idx,
-		   (PTW32_INTERLOCKED_LONG) 1,
-		   (PTW32_INTERLOCKED_LONG) 0) == 0)
+      if (_InterlockedCompareExchange(&mx->lock_idx, 1, 0) == 0)
 	{
 	  mx->recursive_count = 1;
 	  mx->ownerThread = self;
@@ -175,9 +168,7 @@
 	    }
 	  else
 	    {
-              while ((LONG) PTW32_INTERLOCKED_EXCHANGE(
-                              (LPLONG) &mx->lock_idx,
-			      (LONG) -1) != 0)
+              while (_InterlockedExchange(&mx->lock_idx, -1) != 0)
                 {
 		  if (0 != (result = ptw32_timed_eventwait (mx->event, abstime)))
 		    {

 

  ViewVC Help
Powered by ViewVC 1.1.22