mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Complete update of NSThread for MacOS-X 10.5 compatibility. Needs testing.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26332 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
766e0dbf1a
commit
7c710cfbcb
9 changed files with 454 additions and 300 deletions
|
@ -275,6 +275,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
|
|||
|
||||
- (BOOL) pollUntil: (int)milliseconds within: (NSArray*)contexts
|
||||
{
|
||||
GSRunLoopThreadInfo *threadInfo = GSRunLoopForThread(nil, YES);
|
||||
NSMapEnumerator hEnum;
|
||||
GSRunLoopWatcher *watcher;
|
||||
HANDLE handleArray[MAXIMUM_WAIT_OBJECTS-1];
|
||||
|
@ -302,8 +303,9 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
|
|||
GSIArrayRemoveAllItems(_trigger);
|
||||
|
||||
i = GSIArrayCount(watchers);
|
||||
num_handles = 0;
|
||||
num_handles = 1; // One handle for signals from other threads
|
||||
num_winMsgs = 0;
|
||||
|
||||
while (i-- > 0)
|
||||
{
|
||||
GSRunLoopWatcher *info;
|
||||
|
@ -381,6 +383,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
|
|||
}
|
||||
|
||||
i = 0;
|
||||
handleArray[i++] = threadInfo->event; // Signal from other thread
|
||||
hEnum = NSEnumerateMapTable(handleMap);
|
||||
while (NSNextMapEnumeratorPair(&hEnum, &handle, (void**)&watcher))
|
||||
{
|
||||
|
@ -521,7 +524,14 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
|
|||
|
||||
handle = handleArray[i];
|
||||
|
||||
watcher = (GSRunLoopWatcher*)NSMapGet(handleMap, (void*)handle);
|
||||
if (handle == threadInfo->event)
|
||||
{
|
||||
[threadInfo fire];
|
||||
}
|
||||
else
|
||||
{
|
||||
watcher = (GSRunLoopWatcher*)NSMapGet(handleMap, (void*)handle);
|
||||
}
|
||||
if (watcher != nil && watcher->_invalidated == NO)
|
||||
{
|
||||
i = [contexts count];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue