Skip to content

Commit f069950

Browse files
authored
Merge pull request #2917 from readdle/5.3-tls-cleanup
[5.3] Windows, remove obsolete TLS finalization
2 parents 1ad3b0e + f12636f commit f069950

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

CoreFoundation/Base.subproj/CFPlatform.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -659,16 +659,6 @@ CF_PRIVATE void __CFTSDWindowsCleanup() {
659659
FlsFree(__CFTSDIndexKey);
660660
}
661661

662-
// Called for each thread as it exits, on Windows only
663-
CF_PRIVATE void __CFFinalizeWindowsThreadData() {
664-
// Normally, this should call the finalizer several times to emulate the behavior of pthreads on Windows. However, a few bugs keep us from doing this:
665-
// <rdar://problem/8989063> REGRESSION(CF-610-CF-611): Crash closing Safari in BonjourDB destructor (Windows)
666-
// <rdar://problem/9326814> SyncUIHandler crashes after conflict is resolved and we do SyncNow
667-
// and a bug in dispatch keeps us from using pthreadsWin32 directly, because it does not deal with the case of a dispatch_async happening during process exit (it attempts to create a thread, but that is illegal on Win32 and causes a hang).
668-
// So instead we just finalize once, which is the behavior pre-Airwolf anyway
669-
__CFTSDFinalize(TlsGetValue(__CFTSDIndexKey));
670-
}
671-
672662
#else
673663

674664
static _CFThreadSpecificKey __CFTSDIndexKey;

CoreFoundation/Base.subproj/CFRuntime.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,6 @@ CF_PRIVATE void __CFTSDInitialize(void);
978978
#if TARGET_OS_WIN32
979979
// From CFPlatform.c
980980
CF_PRIVATE void __CFTSDWindowsCleanup(void);
981-
CF_PRIVATE void __CFFinalizeWindowsThreadData(void);
982981
#endif
983982

984983
#if TARGET_OS_MAC
@@ -1352,8 +1351,6 @@ int DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID pReserved ) {
13521351
// do these last
13531352
if (cfBundle) CFRelease(cfBundle);
13541353
__CFStringCleanup();
1355-
} else if (dwReason == DLL_THREAD_DETACH) {
1356-
__CFFinalizeWindowsThreadData();
13571354
}
13581355
return TRUE;
13591356
}

0 commit comments

Comments
 (0)