ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.c
(Generate patch)

Comparing libev/ev.c (file contents):
Revision 1.385 by root, Wed Jul 20 01:04:03 2011 UTC vs.
Revision 1.388 by root, Fri Jul 29 12:17:26 2011 UTC

511#ifndef ECB_MEMORY_FENCE 511#ifndef ECB_MEMORY_FENCE
512 #if ECB_GCC_VERSION(4,4) 512 #if ECB_GCC_VERSION(4,4)
513 #define ECB_MEMORY_FENCE __sync_synchronize () 513 #define ECB_MEMORY_FENCE __sync_synchronize ()
514 #define ECB_MEMORY_FENCE_ACQUIRE ({ char dummy = 0; __sync_lock_test_and_set (&dummy, 1); }) 514 #define ECB_MEMORY_FENCE_ACQUIRE ({ char dummy = 0; __sync_lock_test_and_set (&dummy, 1); })
515 #define ECB_MEMORY_FENCE_RELEASE ({ char dummy = 1; __sync_lock_release (&dummy ); }) 515 #define ECB_MEMORY_FENCE_RELEASE ({ char dummy = 1; __sync_lock_release (&dummy ); })
516 #elif defined(_WIN32) && defined(MemoryBarrier) 516 #elif _MSC_VER >= 1400 && 0 /* TODO: only true when using volatiles */
517 #define ECB_MEMORY_FENCE do { } while (0)
518 #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE
519 #define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE
520 #elif defined(_WIN32)
521 #include <WinNT.h>
517 #define ECB_MEMORY_FENCE MemoryBarrier () 522 #define ECB_MEMORY_FENCE MemoryBarrier ()
518 #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE 523 #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE
519 #define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE 524 #define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE
520 #endif 525 #endif
521#endif 526#endif
1456 1461
1457inline_speed void 1462inline_speed void
1458evpipe_write (EV_P_ EV_ATOMIC_T *flag) 1463evpipe_write (EV_P_ EV_ATOMIC_T *flag)
1459{ 1464{
1460 if (expect_true (*flag)) 1465 if (expect_true (*flag))
1461 /*return*//*D*/; 1466 return;
1462 1467
1463 *flag = 1; 1468 *flag = 1;
1464 1469
1465 ECB_MEMORY_FENCE_RELEASE; /* make sure flag is visible before the wakeup */ 1470 ECB_MEMORY_FENCE_RELEASE; /* make sure flag is visible before the wakeup */
1466 1471

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines