|
25 | 25 | # include "tsan_interceptors.h"
|
26 | 26 | # include "tsan_interface.h"
|
27 | 27 | # include "tsan_interface_ann.h"
|
28 |
| -# include "tsan_spinlock_defs_mac.h" |
29 | 28 |
|
30 | 29 | # if defined(__has_include) && __has_include(<xpc/xpc.h>)
|
31 | 30 | # include <xpc/xpc.h>
|
@@ -196,6 +195,17 @@ TSAN_INTERCEPTOR(void *, OSAtomicFifoDequeue, OSFifoQueueHead *list,
|
196 | 195 |
|
197 | 196 | # endif
|
198 | 197 |
|
| 198 | +// If `OSSPINLOCK_USE_INLINED=1` is set, then SDK headers don't declare these |
| 199 | +// as functions, but macros that call non-deprecated APIs. Undefine these |
| 200 | +// macros so they don't interfere with the interceptor machinery. |
| 201 | +# undef OSSpinLockLock |
| 202 | +# undef OSSpinLockTry |
| 203 | +# undef OSSpinLockUnlock |
| 204 | + |
| 205 | +# pragma clang diagnostic push |
| 206 | +// OSSpinLock* functions are deprecated. |
| 207 | +# pragma clang diagnostic ignored "-Wdeprecated-declarations" |
| 208 | + |
199 | 209 | TSAN_INTERCEPTOR(void, OSSpinLockLock, volatile OSSpinLock *lock) {
|
200 | 210 | CHECK(!cur_thread()->is_dead);
|
201 | 211 | if (!cur_thread()->is_inited) {
|
@@ -227,6 +237,7 @@ TSAN_INTERCEPTOR(void, OSSpinLockUnlock, volatile OSSpinLock *lock) {
|
227 | 237 | Release(thr, pc, (uptr)lock);
|
228 | 238 | REAL(OSSpinLockUnlock)(lock);
|
229 | 239 | }
|
| 240 | +# pragma clang diagnostic pop // OSSpinLock* deprecation |
230 | 241 |
|
231 | 242 | TSAN_INTERCEPTOR(void, os_lock_lock, void *lock) {
|
232 | 243 | CHECK(!cur_thread()->is_dead);
|
|
0 commit comments