Skip to content

Commit a365d94

Browse files
committed
s
1 parent 0759969 commit a365d94

File tree

5 files changed

+4
-8
lines changed

5 files changed

+4
-8
lines changed

CoreFoundation/Base.subproj/CFBase.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -623,11 +623,6 @@ CFIndex CFAllocatorGetPreferredSizeForSize(CFAllocatorRef allocator, CFIndex siz
623623
CF_EXPORT
624624
void CFAllocatorGetContext(CFAllocatorRef allocator, CFAllocatorContext *context);
625625

626-
#if DEPLOYMENT_TARGET_LINUX
627-
CF_EXPORT
628-
int _CFIsMainThread(void);
629-
#endif
630-
631626

632627
/* Polymorphic CF functions */
633628

CoreFoundation/Base.subproj/CFInternal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,6 @@ CF_EXPORT void _NS_pthread_setname_np(const char *name);
806806
#endif
807807

808808
#if DEPLOYMENT_TARGET_LINUX
809-
CF_EXPORT int _CFIsMainThread(void);
810809
#define pthread_main_np _CFIsMainThread
811810
#endif
812811

CoreFoundation/Base.subproj/CFPlatform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ const char *_CFProcessPath(void) {
159159
#include <unistd.h>
160160
#include <syscall.h>
161161

162-
int _CFIsMainThread(void) {
162+
Boolean _CFIsMainThread(void) {
163163
return syscall(SYS_gettid) == getpid();
164164
}
165165

CoreFoundation/Base.subproj/ForSwiftFoundationOnly.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ CF_PRIVATE CF_EXPORT char *_Nullable *_Nonnull _CFEnviron(void);
243243

244244
CF_EXPORT void CFLog1(CFLogLevel lev, CFStringRef message);
245245

246+
CF_EXPORT Boolean _CFIsMainThread(void);
247+
246248
_CF_EXPORT_SCOPE_END
247249

248250
#endif /* __COREFOUNDATION_FORSWIFTFOUNDATIONONLY__ */

Foundation/NSOperation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Dispatch
1212
#if os(Linux)
1313
import CoreFoundation
1414
private func pthread_main_np() -> Int32 {
15-
return _CFIsMainThread()
15+
return _CFIsMainThread() ? 1 : 0
1616
}
1717
#endif
1818
#endif

0 commit comments

Comments
 (0)