mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-02 01:21:08 +00:00
minor performance tweak when handling lots of performs on other threads.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32020 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5a597ddc01
commit
fbf77be14b
1 changed files with 10 additions and 1 deletions
|
@ -1036,11 +1036,20 @@ static void *nsthreadLauncher(void* thread)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
c = [performers count];
|
||||||
|
if (0 == c)
|
||||||
|
{
|
||||||
|
/* We deal with all available performers each time we fire, so
|
||||||
|
* it's likely that we will fire when we have no performers left.
|
||||||
|
* In that case we can skip the copying and emptying of the array.
|
||||||
|
*/
|
||||||
|
[lock unlock];
|
||||||
|
return;
|
||||||
|
}
|
||||||
toDo = [NSArray arrayWithArray: performers];
|
toDo = [NSArray arrayWithArray: performers];
|
||||||
[performers removeAllObjects];
|
[performers removeAllObjects];
|
||||||
[lock unlock];
|
[lock unlock];
|
||||||
|
|
||||||
c = [toDo count];
|
|
||||||
for (i = 0; i < c; i++)
|
for (i = 0; i < c; i++)
|
||||||
{
|
{
|
||||||
GSPerformHolder *h = [toDo objectAtIndex: i];
|
GSPerformHolder *h = [toDo objectAtIndex: i];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue