|
From: <sv...@va...> - 2012-04-19 11:00:46
|
bart 2012-04-19 12:00:32 +0100 (Thu, 19 Apr 2012)
New Revision: 12509
Log:
scheduler, ticket lock: Add memory barriers necessary to avoid a deadlock on PowerPC systems
Modified files:
trunk/coregrind/m_scheduler/ticket-lock-linux.c
Modified: trunk/coregrind/m_scheduler/ticket-lock-linux.c (+2 -0)
===================================================================
--- trunk/coregrind/m_scheduler/ticket-lock-linux.c 2012-04-18 19:42:34 +01:00 (rev 12508)
+++ trunk/coregrind/m_scheduler/ticket-lock-linux.c 2012-04-19 12:00:32 +01:00 (rev 12509)
@@ -127,6 +127,7 @@
VG_(gettid)(), ticket);
for (;;) {
futex_value = *futex;
+ __sync_synchronize();
if (ticket == p->head)
break;
if (s_debug)
@@ -142,6 +143,7 @@
vg_assert(False);
}
}
+ __sync_synchronize();
INNER_REQUEST(ANNOTATE_RWLOCK_ACQUIRED(p, /*is_w*/1));
vg_assert(p->owner == 0);
p->owner = VG_(gettid)();
|