changes from bug #40930

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37478 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2013-12-20 10:18:12 +00:00
parent 48bdc3800c
commit 15e7c8f897
4 changed files with 26 additions and 6 deletions

View file

@ -710,12 +710,9 @@ static inline BOOL timerInvalidated(NSTimer *t)
}
}
/**
* Returns the run loop instance for the current thread.
*/
+ (NSRunLoop*) currentRunLoop
+ (NSRunLoop*) _runLoopForThread: (NSThread*) aThread
{
GSRunLoopThreadInfo *info = GSRunLoopInfoForThread(nil);
GSRunLoopThreadInfo *info = GSRunLoopInfoForThread(aThread);
NSRunLoop *current = info->loop;
if (nil == current)
@ -772,6 +769,16 @@ static inline BOOL timerInvalidated(NSTimer *t)
return current;
}
+ (NSRunLoop*) currentRunLoop
{
return [self _runLoopForThread: nil];
}
+ (NSRunLoop*) mainRunLoop
{
return [self _runLoopForThread: [NSThread mainThread]];
}
- (id) init
{
DESTROY(self);