From 612ed04160545e723ba702387ca8d7a2259487c7 Mon Sep 17 00:00:00 2001 From: rfm Date: Wed, 3 Feb 2010 09:31:59 +0000 Subject: [PATCH] windows tweaks git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29468 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSException.m | 4 ++-- Source/NSThread.m | 8 +++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 10c8c3e88..ddb548703 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-02-03 Richard Frith-Macdonald + + * Source/NSThread.m: + Don't use usleep() on windows .. it performas a busy wait so the + Sleep() function is better. + 2010-02-01 Richard Frith-Macdonald * Source/NSAutoreleasePool.m: diff --git a/Source/NSException.m b/Source/NSException.m index 352f2e29d..7576c6282 100644 --- a/Source/NSException.m +++ b/Source/NSException.m @@ -99,7 +99,7 @@ GSPrivateBaseAddress(void *addr, void **base) */ if (VirtualQuery (addr, &info, sizeof(info)) != 0) { - HMODULE handle = (HMODULE) mbi.AllocationBase; + HMODULE handle = (HMODULE) info.AllocationBase; unichar path[MAX_PATH+1]; if (GetModuleFileNameW(handle, path, sizeof(path)-1) != 0) @@ -107,7 +107,7 @@ GSPrivateBaseAddress(void *addr, void **base) path[sizeof(path)-1] = '\0'; *base = info.BaseAddress; - return [[NSString stringWithCharacters: path length: wcslen(path)]]; + return [NSString stringWithCharacters: path length: wcslen(path)]; } } return nil; diff --git a/Source/NSThread.m b/Source/NSThread.m index 48d5b0f25..d42627f25 100644 --- a/Source/NSThread.m +++ b/Source/NSThread.m @@ -220,14 +220,12 @@ GSSleepUntilIntervalSinceReferenceDate(NSTimeInterval when) */ while (delay > 0) { -#ifdef HAVE_USLEEP +#if defined(__MINGW32__) + Sleep ((NSInteger)(delay*1000)); +#elif defined(HAVE_USLEEP) usleep ((NSInteger)(delay*1000000)); -#else -#if defined(__MINGW32__) - Sleep (delay*1000); #else sleep ((NSInteger)delay); -#endif #endif delay = when - GSTimeNow(); }