[evolution-patches] partial fix for #60889 (and other spurious behavior possibly)



Turns out libdb has a flag you can pass to db->open that should enable
some threadsafe behavior.

Chris
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/ChangeLog,v
retrieving revision 1.187
diff -u -r1.187 ChangeLog
--- ChangeLog	13 Aug 2004 14:51:10 -0000	1.187
+++ ChangeLog	16 Aug 2004 16:25:09 -0000
@@ -1,3 +1,10 @@
+2004-08-16  Chris Toshok  <toshok ximian com>
+
+	[ part of fix for #60889 ]
+	* backends/file/e-book-backend-file.c
+	(e_book_backend_file_load_source): add DB_THREAD flag to all calls
+	to db->open.
+
 2004-08-13  Sivaiah Nallagatla <snallagatla novell com>
 
 	* backends/groupwise/e-book-backend-groupwise.c 
Index: backends/file/e-book-backend-file.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/backends/file/e-book-backend-file.c,v
retrieving revision 1.21
diff -u -r1.21 e-book-backend-file.c
--- backends/file/e-book-backend-file.c	12 Jul 2004 18:21:48 -0000	1.21
+++ backends/file/e-book-backend-file.c	16 Aug 2004 16:25:09 -0000
@@ -928,7 +928,7 @@
 		return GNOME_Evolution_Addressbook_OtherError;
 	}
 
-	db_error = db->open (db, NULL, filename, NULL, DB_HASH, 0, 0666);
+	db_error = db->open (db, NULL, filename, NULL, DB_HASH, DB_THREAD, 0666);
 
 	if (db_error == DB_OLD_VERSION) {
 		db_error = e_db3_utils_upgrade_format (filename);
@@ -938,7 +938,7 @@
 			return GNOME_Evolution_Addressbook_OtherError;
 		}
 
-		db_error = db->open (db, NULL, filename, NULL, DB_HASH, 0, 0666);
+		db_error = db->open (db, NULL, filename, NULL, DB_HASH, DB_THREAD, 0666);
 	}
 
 	bf->priv->file_db = db;
@@ -946,7 +946,7 @@
 	if (db_error == 0) {
 		writable = TRUE;
 	} else {
-		db_error = db->open (db, NULL, filename, NULL, DB_HASH, DB_RDONLY, 0666);
+		db_error = db->open (db, NULL, filename, NULL, DB_HASH, DB_RDONLY | DB_THREAD, 0666);
 
 		if (db_error != 0 && !only_if_exists) {
 			int rv;
@@ -962,7 +962,7 @@
 					return GNOME_Evolution_Addressbook_OtherError;
 			}
 
-			db_error = db->open (db, NULL, filename, NULL, DB_HASH, DB_CREATE, 0666);
+			db_error = db->open (db, NULL, filename, NULL, DB_HASH, DB_CREATE | DB_THREAD, 0666);
 			if (db_error != 0) {
 				g_warning ("db->open (... DB_CREATE ...) failed with %d", db_error);
 			}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]