summaryrefslogtreecommitdiff
path: root/hw/xquartz/darwinEvents.c
diff options
context:
space:
mode:
authorJeremy Huddleston Sequoia <jeremyhu@apple.com>2016-09-19 09:34:50 -0700
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2016-09-22 14:55:03 -0700
commitf72ff1f7ac784f3911fe2f8d746f62f7709f0edc (patch)
tree9cdb853e9558f9dab6b03c8a202af8418e3cea1a /hw/xquartz/darwinEvents.c
parent7d6ebf3f4e4d517bb846d15a5deb131da19a267c (diff)
XQuartz: Silence an expected TSan warning
This code is safe. If the data race fails, the result is that we take the lock and recheck. ================== WARNING: ThreadSanitizer: data race (pid=31401) Read of size 1 at 0x00010f5d2500 by thread T11: #0 wait_for_mieq_init darwinEvents.c:102 (X11.bin+0x00010003155a) #1 -[X11Application(Private) sendX11NSEvent:] X11Application.m:1330 (X11.bin+0x00010001d652) #2 __28-[X11Application sendEvent:]_block_invoke X11Application.m:476 (X11.bin+0x00010001887f) #3 __tsan::invoke_and_release_block(void*) <null>:144 (libclang_rt.tsan_osx_dynamic.dylib+0x00000005d97b) #4 _dispatch_client_callout <null>:33 (libdispatch.dylib+0x0000000020ef) Previous write of size 1 at 0x00010f5d2500 by thread T8: [failed to restore the stack] Location is global 'mieqInitialized' at 0x00010f5d2500 (X11.bin+0x000100599500) Thread T11 (tid=4367138, running) created by thread T-1 [failed to restore the stack] Thread T8 (tid=4367130, running) created by main thread at: #0 pthread_create <null>:144 (libclang_rt.tsan_osx_dynamic.dylib+0x000000024490) #1 create_thread quartzStartup.c:78 (X11.bin+0x000100039d2d) #2 QuartzInitServer quartzStartup.c:95 (X11.bin+0x000100039b96) #3 X11ApplicationMain X11Application.m:1238 (X11.bin+0x00010001cd54) #4 X11ControllerMain X11Controller.m:984 (X11.bin+0x00010002a5b2) #5 server_main quartzStartup.c:136 (X11.bin+0x000100039fbb) #6 do_start_x11_server bundle-main.c:436 (X11.bin+0x000100002e25) #7 _Xstart_x11_server mach_startupServer.c:189 (X11.bin+0x000100004e09) #8 mach_startup_server mach_startupServer.c:399 (X11.bin+0x0001000056a4) #9 mach_msg_server mach_msg.c:563 (libsystem_kernel.dylib+0x000000012186) #10 start <null>:29 (libdyld.dylib+0x000000005254) SUMMARY: ThreadSanitizer: data race darwinEvents.c:102 in wait_for_mieq_init ================== Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Diffstat (limited to 'hw/xquartz/darwinEvents.c')
-rw-r--r--hw/xquartz/darwinEvents.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index a3b70f569..fd87e968b 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -96,6 +96,7 @@ static BOOL mieqInitialized;
static pthread_mutex_t mieqInitializedMutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t mieqInitializedCond = PTHREAD_COND_INITIALIZER;
+_X_NOTSAN
extern inline void
wait_for_mieq_init(void)
{
@@ -108,6 +109,7 @@ wait_for_mieq_init(void)
}
}
+_X_NOTSAN
static inline void
signal_mieq_init(void)
{