diff options
Diffstat (limited to 'pthread_win32_attach_detach_np.c')
-rw-r--r-- | pthread_win32_attach_detach_np.c | 64 |
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 */ |