python/dist/src/Lib/bsddb __init__.py,1.9,1.10

Update of /cvsroot/python/python/dist/src/Lib/bsddb In directory sc8-pr-cvs1:/tmp/cvs-serv11621/bsddb Modified Files: __init__.py Log Message: Use a threadsafe private DBEnv for each bsddb compatibility interface db that is opened. DB_THREAD and DB_INIT_LOCK allow for multithreaded access. DB_PRIVATE prevents the DBEnv from using the filesystem (making it only usable by this process; and in this implementation using one DBEnv per bsddb database) Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/__init__.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** __init__.py 21 Sep 2003 00:08:14 -0000 1.9 --- __init__.py 27 Sep 2003 23:00:19 -0000 1.10 *************** *** 190,194 **** flags = _checkflag(flag) ! d = db.DB() d.set_flags(hflags) if cachesize is not None: d.set_cachesize(0, cachesize) --- 190,195 ---- flags = _checkflag(flag) ! e = _openDBEnv() ! d = db.DB(e) d.set_flags(hflags) if cachesize is not None: d.set_cachesize(0, cachesize) *************** *** 207,211 **** flags = _checkflag(flag) ! d = db.DB() if cachesize is not None: d.set_cachesize(0, cachesize) if pgsize is not None: d.set_pagesize(pgsize) --- 208,213 ---- flags = _checkflag(flag) ! e = _openDBEnv() ! d = db.DB(e) if cachesize is not None: d.set_cachesize(0, cachesize) if pgsize is not None: d.set_pagesize(pgsize) *************** *** 225,229 **** flags = _checkflag(flag) ! d = db.DB() if cachesize is not None: d.set_cachesize(0, cachesize) if pgsize is not None: d.set_pagesize(pgsize) --- 227,232 ---- flags = _checkflag(flag) ! e = _openDBEnv() ! d = db.DB(e) if cachesize is not None: d.set_cachesize(0, cachesize) if pgsize is not None: d.set_pagesize(pgsize) *************** *** 239,242 **** --- 242,249 ---- #---------------------------------------------------------------------- + def _openDBEnv(): + e = db.DBEnv() + e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) + return e def _checkflag(flag):
participants (1)
-
gregļ¼ users.sourceforge.net