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:
rfm 2009-01-05 11:26:25 +00:00
parent aa26b4ea10
commit 49dfed3d80
5 changed files with 29 additions and 4 deletions

View file

@ -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)
{