minor simplification

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28645 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-09-09 08:21:51 +00:00
parent f9a9ac787f
commit 65fb6dd5ac

View file

@ -90,6 +90,8 @@
#define PTHREAD_MIN_PRIORITY 0
#endif
extern NSTimeInterval GSTimeNow(void);
@interface NSAutoreleasePool (NSThread)
+ (void) _endThread: (NSThread*)thread;
@end
@ -151,12 +153,11 @@ static NSNotificationCenter *nc = nil;
void
GSSleepUntilIntervalSinceReferenceDate(NSTimeInterval when)
{
extern NSTimeInterval GSTimeNow(void);
NSTimeInterval delay;
// delay is always the number of seconds we still need to wait
delay = when - GSTimeNow();
if (delay <= 0)
if (delay <= 0.0)
{
sched_yield();
return;
@ -583,15 +584,7 @@ static void setThreadForCurrentThread(NSThread *t)
+ (void) sleepForTimeInterval: (NSTimeInterval)ti
{
if (ti > 0.0)
{
GSSleepUntilIntervalSinceReferenceDate(
[NSDate timeIntervalSinceReferenceDate] + ti);
}
else
{
sched_yield();
}
GSSleepUntilIntervalSinceReferenceDate(GSTimeNow() + ti);
}
/**