Author: rfm
Date: Tue May 27 17:22:35 2014
New Revision: 37913

URL: http://svn.gna.org/viewcvs/gnustep?rev=37913&view=rev
Log:
bugfix release for thread safety of notifications

Modified:
    libs/sqlclient/trunk/ChangeLog
    libs/sqlclient/trunk/GNUmakefile
    libs/sqlclient/trunk/Postgres.m
    libs/sqlclient/trunk/SQLClient.h

Modified: libs/sqlclient/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/ChangeLog?rev=37913&r1=37912&r2=37913&view=diff
==============================================================================
--- libs/sqlclient/trunk/ChangeLog      (original)
+++ libs/sqlclient/trunk/ChangeLog      Tue May 27 17:22:35 2014
@@ -1,3 +1,12 @@
+2014-05-27 Richard Frith-Macdonald  <[email protected]>
+
+        * 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  <[email protected]>
 
         * SQLClient.m: More locking to try to protect all access to the

Modified: libs/sqlclient/trunk/GNUmakefile
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/GNUmakefile?rev=37913&r1=37912&r2=37913&view=diff
==============================================================================
--- libs/sqlclient/trunk/GNUmakefile    (original)
+++ libs/sqlclient/trunk/GNUmakefile    Tue May 27 17:22:35 2014
@@ -21,7 +21,7 @@
 -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

Modified: libs/sqlclient/trunk/Postgres.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/Postgres.m?rev=37913&r1=37912&r2=37913&view=diff
==============================================================================
--- libs/sqlclient/trunk/Postgres.m     (original)
+++ libs/sqlclient/trunk/Postgres.m     Tue May 27 17:22:35 2014
@@ -439,8 +439,18 @@
 
 - (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];
 }
 

Modified: libs/sqlclient/trunk/SQLClient.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/SQLClient.h?rev=37913&r1=37912&r2=37913&view=diff
==============================================================================
--- libs/sqlclient/trunk/SQLClient.h    (original)
+++ libs/sqlclient/trunk/SQLClient.h    Tue May 27 17:22:35 2014
@@ -1128,7 +1128,12 @@
  * 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


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to