File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 24
24
25
25
extern " C" const char *__progname;
26
26
27
- // This function may not be present when building at desk, and isn't really
28
- // needed there, so just skip it in that case.
29
- #if SWIFT_BNI_OS_BUILD
27
+ #if SWIFT_USE_OS_TRACE_LAZY_INIT
30
28
extern " C" bool _os_trace_lazy_init_completed_4swift (void );
31
29
#endif
32
30
@@ -47,7 +45,7 @@ static inline bool shouldEnableTracing() {
47
45
}
48
46
49
47
static inline bool tracingReady () {
50
- #if SWIFT_BNI_OS_BUILD
48
+ #if SWIFT_USE_OS_TRACE_LAZY_INIT
51
49
if (!_os_trace_lazy_init_completed_4swift ())
52
50
return false ;
53
51
#endif
Original file line number Diff line number Diff line change @@ -474,6 +474,10 @@ function(_add_target_variant_c_compile_flags)
474
474
list (APPEND result "-DSWIFT_STDLIB_OVERRIDABLE_RETAIN_RELEASE" )
475
475
endif ()
476
476
477
+ if (SWIFT_USE_OS_TRACE_LAZY_INIT )
478
+ list (APPEND result "-DSWIFT_USE_OS_TRACE_LAZY_INIT" )
479
+ endif ()
480
+
477
481
list (APPEND result ${SWIFT_STDLIB_EXTRA_C_COMPILE_FLAGS} )
478
482
479
483
set ("${CFLAGS_RESULT_VAR_NAME} " "${result} " PARENT_SCOPE )
Original file line number Diff line number Diff line change @@ -210,6 +210,10 @@ option(SWIFT_STDLIB_SINGLE_THREADED_CONCURRENCY
210
210
"Build the standard libraries assuming that they will be used in an environment with only a single thread."
211
211
FALSE )
212
212
213
+ option (SWIFT_USE_OS_TRACE_LAZY_INIT
214
+ "Use the os_trace call to check if lazy init has been completed before making os_signpost calls."
215
+ FALSE )
216
+
213
217
# Use dispatch as the system scheduler by default.
214
218
# For convenience, we set this to false when concurrency is disabled.
215
219
set (SWIFT_CONCURRENCY_USES_DISPATCH FALSE )
You can’t perform that action at this time.
0 commit comments