From 66a58406ccd103f711541d65b3c1d85ab964845b Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 29 Oct 2002 22:03:34 +0000 Subject: [PATCH] removed previous change that allowed w95, but introduced a bug --- src/libCom/osi/os/WIN32/osdThread.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/libCom/osi/os/WIN32/osdThread.c b/src/libCom/osi/os/WIN32/osdThread.c index f452fb7d4..3deddd519 100644 --- a/src/libCom/osi/os/WIN32/osdThread.c +++ b/src/libCom/osi/os/WIN32/osdThread.c @@ -402,14 +402,11 @@ static void epicsThreadInit ( void ) return; } -#if 1 - /* not arch neutral, but at least supported by w95 and borland */ - if ( InterlockedExchange ( (LPLONG) &win32ThreadGlobalMutex, (LONG) win32ThreadGlobalMutexTmp ) ) { -#else - /* not supported on W95, but the alternative requires assuming that pointer and integer are the same */ - if ( InterlockedCompareExchange ( (PVOID *) &win32ThreadGlobalMutex, - (PVOID) win32ThreadGlobalMutexTmp, (PVOID)0 ) != 0) { -#endif + /* + * not supported on W95 but supported on Borland 551 + */ + if ( InterlockedCompareExchangePointer ( &win32ThreadGlobalMutex, + win32ThreadGlobalMutexTmp, 0 ) != 0) { CloseHandle (win32ThreadGlobalMutexTmp); /* wait for init to complete */ status = WaitForSingleObject ( win32ThreadGlobalMutex, INFINITE );