From 78ba4d7f20330ae3c96df87bb4ed018def866b25 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Sat, 18 Sep 2004 05:24:34 +0000 Subject: [PATCH] hold lock during db enum -- reduce memory requirements by serializing updates (partcuarly with rescan_interval), and because the enum isn't currently reentrant --- src/db-gdbm.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/db-gdbm.c b/src/db-gdbm.c index daf49b84..764dd0af 100644 --- a/src/db-gdbm.c +++ b/src/db-gdbm.c @@ -348,12 +348,9 @@ int db_scanning(void) { */ int db_version(void) { int version; - int err; db_readlock(); - version=db_version_no; - db_unlock(); return version; @@ -897,9 +894,6 @@ ENUMHANDLE db_enum_begin(void) { } helper->next = helper->root; - - db_unlock(); - return helper; } @@ -1034,6 +1028,7 @@ int db_enum_end(ENUMHANDLE handle) { free(helper); + db_unlock(); return 0; }