Skip to content

Commit c54dccb

Browse files
authored
[Concurrency] Move debug-only pthread code into the debug-only #ifdef (swiftlang#41278)
1 parent 49b3876 commit c54dccb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

stdlib/public/Concurrency/TaskPrivate.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,12 @@ namespace swift {
4747
// Set to 1 to enable helpful debug spew to stderr
4848
// If this is enabled, tests with `swift_task_debug_log` requirement can run.
4949
#if 0
50+
5051
#define SWIFT_TASK_DEBUG_LOG(fmt, ...) \
5152
fprintf(stderr, "[%lu] [%s:%d](%s) " fmt "\n", \
5253
(unsigned long)_swift_get_thread_id(), \
5354
__FILE__, __LINE__, __FUNCTION__, \
5455
__VA_ARGS__)
55-
#else
56-
#define SWIFT_TASK_DEBUG_LOG(fmt, ...) (void)0
57-
#endif
5856

5957
#if defined(_WIN32)
6058
using ThreadID = decltype(GetCurrentThreadId());
@@ -70,6 +68,10 @@ inline ThreadID _swift_get_thread_id() {
7068
#endif
7169
}
7270

71+
#else
72+
#define SWIFT_TASK_DEBUG_LOG(fmt, ...) (void)0
73+
#endif
74+
7375
class AsyncTask;
7476
class TaskGroup;
7577

0 commit comments

Comments
 (0)