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(); }