Skip to content

Commit 9597735

Browse files
authored
Merge pull request #81955 from mikeash/os-unfair-recursive-lock-declarations
[Runtime] Don't redeclare os_unfair_recursive_lock et al if the SDK has them.
2 parents 296726a + 650027e commit 9597735

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/swift/Threading/Impl/Darwin.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ inline void lazy_mutex_unsafe_unlock(lazy_mutex_handle &handle) {
131131

132132
// .. Recursive mutex support .................................................
133133

134-
// The os_unfair_recursive_lock interface is stable, but not in the SDK. Bring
134+
#if OS_LOCK_API_VERSION < 20250601
135+
136+
// The os_unfair_recursive_lock interface is stable, but not in this SDK. Bring
135137
// our own definitions for what we need.
136138

137139
#define OS_UNFAIR_RECURSIVE_LOCK_INIT \
@@ -151,6 +153,8 @@ os_unfair_recursive_lock_lock_with_options(os_unfair_recursive_lock_t lock,
151153
extern "C" void
152154
os_unfair_recursive_lock_unlock(os_unfair_recursive_lock_t lock);
153155

156+
#endif // OS_UNFAIR_RECURSIVE_LOCK_INIT
157+
154158
inline void recursive_mutex_init(recursive_mutex_handle &handle,
155159
bool checked = false) {
156160
handle = OS_UNFAIR_RECURSIVE_LOCK_INIT;

0 commit comments

Comments
 (0)