mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Improve perform in other threads
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27520 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2cc2afa8ff
commit
7ae871d1ac
5 changed files with 29 additions and 4 deletions
|
@ -1129,9 +1129,18 @@ static inline BOOL timerInvalidated(NSTimer *t)
|
|||
GSPrivateNotifyIdle();
|
||||
/*
|
||||
* Pause for as long as possible (up to the limit date)
|
||||
* Call the polling method so we notice thread notifications
|
||||
* that methods should be performed in this loop.
|
||||
*/
|
||||
[NSThread sleepUntilDate: limit_date];
|
||||
ti = [limit_date timeIntervalSinceNow];
|
||||
if (context == nil)
|
||||
{
|
||||
context = [[GSRunLoopCtxt alloc] initWithMode: mode
|
||||
extra: _extra];
|
||||
NSMapInsert(_contextMap, context->mode, context);
|
||||
RELEASE(context);
|
||||
}
|
||||
[context pollUntil: (int)(ti * 1000) within: nil];
|
||||
GSPrivateCheckTasks();
|
||||
if (context != nil)
|
||||
{
|
||||
|
|
|
@ -571,6 +571,7 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
|||
{
|
||||
if (fd == threadInfo->inputFd)
|
||||
{
|
||||
NSDebugMLLog(@"NSRunLoop", @"Fire perform on thread");
|
||||
[threadInfo fire];
|
||||
watcher = nil;
|
||||
}
|
||||
|
@ -950,6 +951,7 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
|||
|
||||
if (fdIndex == threadInfo->inputFd)
|
||||
{
|
||||
NSDebugMLLog(@"NSRunLoop", @"Fire perform on thread");
|
||||
[threadInfo fire];
|
||||
watcher = nil;
|
||||
}
|
||||
|
|
|
@ -527,6 +527,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
|
|||
if (handle == threadInfo->event)
|
||||
{
|
||||
watcher = nil;
|
||||
NSDebugMLLog(@"NSRunLoop", @"Fire perform on thread");
|
||||
[threadInfo fire];
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue