summaryrefslogtreecommitdiff
path: root/pthread_win32_attach_detach_np.c
diff options
context:
space:
mode:
authorrpj <rpj>2011-03-03 23:37:20 +0000
committerrpj <rpj>2011-03-03 23:37:20 +0000
commite470da85f7b9426eea03d66086c2822bf29e9b05 (patch)
treeb3747768258dc62752612327904be1f1067d5c7f /pthread_win32_attach_detach_np.c
parent1170175259781ece4a8d99d517230f4b9ecb7b50 (diff)
Some cleanups, mostly x86_64 compat plus interlocked macros
Diffstat (limited to 'pthread_win32_attach_detach_np.c')
-rw-r--r--pthread_win32_attach_detach_np.c64
1 files changed, 0 insertions, 64 deletions
diff --git a/pthread_win32_attach_detach_np.c b/pthread_win32_attach_detach_np.c
index 7911fe1..bb83fd7 100644
--- a/pthread_win32_attach_detach_np.c
+++ b/pthread_win32_attach_detach_np.c
@@ -91,70 +91,6 @@ pthread_win32_process_attach_np ()
#endif
-#ifdef _WIN64
-
-/*
- * InterlockedCompareExchange routine in WIN64 is an intrinsic function.
- * See PTW32_INTERLOCKED_COMPARE_EXCHANGE implement.h
- */
-
-#else
-
-#ifdef WINCE
-
- /*
- * Load COREDLL and try to get address of InterlockedCompareExchange
- */
- ptw32_h_kernel32 = LoadLibrary (TEXT ("COREDLL.DLL"));
-
-#else
-
- /*
- * Load KERNEL32 and try to get address of InterlockedCompareExchange
- */
- ptw32_h_kernel32 = LoadLibrary (TEXT ("KERNEL32.DLL"));
-
-#endif
-
- ptw32_interlocked_compare_exchange =
- (PTW32_INTERLOCKED_LONG (WINAPI *)
- (PTW32_INTERLOCKED_LPLONG, PTW32_INTERLOCKED_LONG,
- PTW32_INTERLOCKED_LONG))
-#if defined(NEED_UNICODE_CONSTS)
- GetProcAddress (ptw32_h_kernel32,
- (const TCHAR *) TEXT ("InterlockedCompareExchange"));
-#else
- GetProcAddress (ptw32_h_kernel32, (LPCSTR) "InterlockedCompareExchange");
-#endif
-
- if (ptw32_interlocked_compare_exchange == NULL)
- {
- ptw32_interlocked_compare_exchange = ptw32_InterlockedCompareExchange;
-
- /*
- * If InterlockedCompareExchange is not being used, then free
- * the kernel32.dll handle now, rather than leaving it until
- * DLL_PROCESS_DETACH.
- *
- * Note: this is not a pedantic exercise in freeing unused
- * resources! It is a work-around for a bug in Windows 95
- * (see microsoft knowledge base article, Q187684) which
- * does Bad Things when FreeLibrary is called within
- * the DLL_PROCESS_DETACH code, in certain situations.
- * Since w95 just happens to be a platform which does not
- * provide InterlockedCompareExchange, the bug will be
- * effortlessly avoided.
- */
- (void) FreeLibrary (ptw32_h_kernel32);
- ptw32_h_kernel32 = 0;
- }
- else
- {
- ptw32_features |= PTW32_SYSTEM_INTERLOCKED_COMPARE_EXCHANGE;
- }
-
-#endif
-
/*
* Load QUSEREX.DLL and try to get address of QueueUserAPCEx
*/