gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r2158 - GNUnet/src/applications/sqstore_sqlite


From: durner
Subject: [GNUnet-SVN] r2158 - GNUnet/src/applications/sqstore_sqlite
Date: Mon, 3 Oct 2005 11:01:49 -0700 (PDT)

Author: durner
Date: 2005-10-03 11:00:46 -0700 (Mon, 03 Oct 2005)
New Revision: 2158

Modified:
   GNUnet/src/applications/sqstore_sqlite/sqlite.c
Log:
Remove duplicate locking

Modified: GNUnet/src/applications/sqstore_sqlite/sqlite.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlite.c     2005-10-03 17:22:14 UTC 
(rev 2157)
+++ GNUnet/src/applications/sqstore_sqlite/sqlite.c     2005-10-03 18:00:46 UTC 
(rev 2158)
@@ -82,10 +82,7 @@
   unsigned int handle_count;
   
   /* List of open handles */
-  sqliteHandle *handles;
-  
-  /* Mutex for *handles */
-  Mutex handle_lock;
+  sqliteHandle *handles;  
 } sqliteDatabase;
 
 
@@ -120,8 +117,6 @@
   sqliteHandle *ret = NULL;
   sqlite3_stmt *stmt;
   
-  MUTEX_LOCK(&db->handle_lock);
-  
   /* Is the DB already open? */
   this_tid = pthread_self();
   for(idx = 0; idx < db->handle_count; idx++)
@@ -144,7 +139,6 @@
     if (sqlite3_open(db->fn, &ret->dbh) != SQLITE_OK) {
       LOG(LOG_ERROR,
           _("Unable to initialize SQLite.\n"));
-      MUTEX_UNLOCK(&db->handle_lock);
       
       FREE(db->fn);
       FREE(db);
@@ -156,8 +150,6 @@
     sqlite3_exec(ret->dbh, "PRAGMA count_changes=OFF", NULL, NULL, NULL);
     sqlite3_exec(ret->dbh, "PRAGMA page_size=4096", NULL, NULL, NULL);
 
-    MUTEX_UNLOCK(&db->handle_lock);
-
     /* We have to do it here, because otherwise precompiling SQL might fail */
     sq_prepare("Select 1 from sqlite_master where tbl_name = 'gn070'",
          &stmt);
@@ -205,8 +197,6 @@
       return NULL;
     }
   }
-  else
-    MUTEX_UNLOCK(&db->handle_lock);
 
   return ret;
 }
@@ -589,7 +579,6 @@
   syncStats();
 
   MUTEX_DESTROY(&db->DATABASE_Lock_);
-  MUTEX_DESTROY(&db->handle_lock);
   FREE(db->fn);
   FREE(db);
   db = NULL;
@@ -1021,7 +1010,6 @@
   FREE(dir);
 
   MUTEX_CREATE(&db->DATABASE_Lock_);
-  MUTEX_CREATE(&db->handle_lock);
 
   dbh = getDBHandle();
   if (!dbh) {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]