Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/CoreFoundation/CFPlatform.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ const char *_CFProcessPath(void) {
#endif
}

#if TARGET_OS_MAC || TARGET_OS_WIN32 || TARGET_OS_BSD
#if TARGET_OS_MAC || TARGET_OS_WIN32 || TARGET_OS_BSD || TARGET_OS_WASI
CF_CROSS_PLATFORM_EXPORT Boolean _CFIsMainThread(void) {
#if defined(__OpenBSD__) || defined(__FreeBSD__)
#if defined(__OpenBSD__) || defined(__FreeBSD__) || TARGET_OS_WASI
return pthread_equal(pthread_self(), _CFMainPThread) != 0;
#else
return pthread_main_np() == 1;
Expand Down
2 changes: 0 additions & 2 deletions Sources/CoreFoundation/CFRuntime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,6 @@ void __CFInitialize(void) {
#elif _POSIX_THREADS
// move this next line up into the #if above after Foundation gets off this symbol. Also: <rdar://problem/39622745> Stop using _CFMainPThread
_CFMainPThread = pthread_self();
#elif TARGET_OS_WASI
_CFMainPThread = kNilPthreadT;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_POSIX_THREADS is now defined and pthread_self is available in wasi-libc, so this line won't be reachable

#else
#error Dont know how to get the main thread on this platform
#endif
Expand Down