Thread safety fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20179 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2004-09-29 08:47:25 +00:00
parent cf50088545
commit 78ab0dc2b2
2 changed files with 10 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2004-09-29 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSNotificationCenter.m: ([_postAndRelease:]) lock table
while emptying array of observers to prevent another thread from
changing things at the same time.
2004-09-27 23:26 Alexander Malmberg <alexander@malmberg.org>
* Source/NSDistantObject.m: Make proxyLocation an enum tag, not a

View file

@ -1060,7 +1060,9 @@ static NSNotificationCenter *default_center = nil;
(*o->method)(o->observer, o->selector, notification);
}
}
lockNCTable(TABLE);
GSIArrayEmpty(a);
unlockNCTable(TABLE);
#if 0
NS_HANDLER
@ -1068,7 +1070,9 @@ static NSNotificationCenter *default_center = nil;
/*
* If we had a problem - release memory before going on.
*/
lockNCTable(TABLE);
GSIArrayEmpty(a);
unlockNCTable(TABLE);
RELEASE(notification);
[localException raise];
}