[PATCH 2/3] sync: Serialise access to the fence before waking clients

Chris Wilson chris at chris-wilson.co.uk
Mon May 12 00:12:38 PDT 2014


By waking the clients before we finish the work associated with the
fence we expose ourselves to a race where the clients may see the
incomplete results.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 miext/sync/misyncshm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/miext/sync/misyncshm.c b/miext/sync/misyncshm.c
index 01f82fc..4d11b57 100644
--- a/miext/sync/misyncshm.c
+++ b/miext/sync/misyncshm.c
@@ -50,9 +50,9 @@ miSyncShmFenceSetTriggered(SyncFence * pFence)
 {
     SyncShmFencePrivatePtr      pPriv = SYNC_FENCE_PRIV(pFence);
 
+    miSyncFenceSetTriggered(pFence);
     if (pPriv->fence)
         xshmfence_trigger(pPriv->fence);
-    miSyncFenceSetTriggered(pFence);
 }
 
 static void
-- 
2.0.0.rc2



More information about the xorg-devel mailing list