mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
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:
parent
f9a9ac787f
commit
65fb6dd5ac
1 changed files with 4 additions and 11 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue