hold lock during db enum -- reduce memory requirements by serializing updates (partcuarly with rescan_interval), and because the enum isn't currently reentrant
This commit is contained in:
parent
537233256b
commit
78ba4d7f20
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue