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:
Richard Frith-Macdonald 2004-09-29 08:47:25 +00:00
parent c668c9d96a
commit 3819dc6661
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> 2004-09-27 23:26 Alexander Malmberg <alexander@malmberg.org>
* Source/NSDistantObject.m: Make proxyLocation an enum tag, not a * 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); (*o->method)(o->observer, o->selector, notification);
} }
} }
lockNCTable(TABLE);
GSIArrayEmpty(a); GSIArrayEmpty(a);
unlockNCTable(TABLE);
#if 0 #if 0
NS_HANDLER NS_HANDLER
@ -1068,7 +1070,9 @@ static NSNotificationCenter *default_center = nil;
/* /*
* If we had a problem - release memory before going on. * If we had a problem - release memory before going on.
*/ */
lockNCTable(TABLE);
GSIArrayEmpty(a); GSIArrayEmpty(a);
unlockNCTable(TABLE);
RELEASE(notification); RELEASE(notification);
[localException raise]; [localException raise];
} }