bugfix release for thread safety of notifications

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/sqlclient/trunk@37913 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2014-05-27 15:22:35 +00:00
parent fc5ee2d382
commit 55eb0f2951
4 changed files with 28 additions and 4 deletions

View file

@ -1,3 +1,12 @@
2014-05-27 Richard Frith-Macdonald <rfm@gnu.org>
* SQLClient.h: Warn about not using the database inside a
notification handler.
* Postgres.m: Add locking around database operations caused
by asynchronous arrival of a notification.
* GNUmakefile: new subminor version for bugfix release
* Version 1.7.3: released
2014-05-19 Richard Frith-Macdonald <rfm@gnu.org>
* SQLClient.m: More locking to try to protect all access to the

View file

@ -21,7 +21,7 @@ include $(GNUSTEP_MAKEFILES)/common.make
-include config.make
PACKAGE_NAME = SQLClient
PACKAGE_VERSION = 1.7.2
PACKAGE_VERSION = 1.7.3
CVS_MODULE_NAME = gnustep/dev-libs/SQLClient
CVS_TAG_NAME = SQLClient
SVN_BASE_URL=svn+ssh://svn.gna.org/svn/gnustep/libs

View file

@ -439,8 +439,18 @@ connectQuote(NSString *str)
- (void) _availableData: (NSNotification*)n
{
PQconsumeInput(connection);
[self _checkNotifications];
[lock lock];
NS_DURING
{
PQconsumeInput(connection);
[self _checkNotifications];
[lock unlock];
}
NS_HANDLER
{
[lock unlock];
}
NS_ENDHANDLER
[fileHandle waitForDataInBackgroundAndNotify];
}

View file

@ -1128,7 +1128,12 @@ SQLCLIENT_PRIVATE
* If the 'Local' value is the boolean YES, the notification originated
* as an action by this SQLClient instance.<br />
* If the 'Payload' value is not nil, then it is a string providing extra
* information about the notification.
* information about the notification.<br />
* NB. At the point when the observer is notified about an event the
* database client object will be locked and may not be used to query
* or modify the database (typically a database query will already be
* in progress). The method handling the notification must therefore
* handle any database operations in a later timeout.
*/
- (void) addObserver: (id)anObserver
selector: (SEL)aSelector