Skip to content
Commit 09d3e53a authored by Kuba Brecka's avatar Kuba Brecka
Browse files

[tsan] dispatch_once interceptor will cause a crash/deadlock when the original...

[tsan] dispatch_once interceptor will cause a crash/deadlock when the original dispatch_once is used

Because we use SCOPED_TSAN_INTERCEPTOR in the dispatch_once interceptor, the original dispatch_once can also be sometimes called (when ignores are enabled or when thr->is_inited is false). However the original dispatch_once function doesn’t expect to find “2” in the storage and it will spin forever (but we use “2” to indicate that the initialization is already done, so no waiting is necessary). This patch makes sure we never call the original dispatch_once.

Differential Revision: http://reviews.llvm.org/D21976

llvm-svn: 274548
parent 976d938c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment