Commit 267c3a34 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9617c6c4
...@@ -641,7 +641,7 @@ pair<FileH, error> _Conn::open(zodb::Oid foid) { ...@@ -641,7 +641,7 @@ pair<FileH, error> _Conn::open(zodb::Oid foid) {
return make_pair(f, nil); return make_pair(f, nil);
} }
// create in-flight-opening FileH entry and perform open with wconn._mu released // create "opening" FileH entry and perform open with wconn._mu released
// NOTE wconn._atMu.R is still held because FileH._open relies on wconn.at being stable. // NOTE wconn._atMu.R is still held because FileH._open relies on wconn.at being stable.
f = adoptref(new _FileH()); f = adoptref(new _FileH());
f->wconn = newref(&wconn); f->wconn = newref(&wconn);
...@@ -660,7 +660,10 @@ pair<FileH, error> _Conn::open(zodb::Oid foid) { ...@@ -660,7 +660,10 @@ pair<FileH, error> _Conn::open(zodb::Oid foid) {
if (!retok) { if (!retok) {
wconn._mu.Lock(); wconn._mu.Lock();
// don't care about f->_nopen-- since f is not returned anywhere // don't care about f->_nopen-- since f is not returned anywhere
// XXX assert filehTab[foid] == f if (wconn._filehTab.get(foid) != f) {
wconn._mu.Unlock();
panic("BUG: wconn.open: wconn.filehTab[foid] mutated while file open was in progress");
}
wconn._filehTab.erase(foid); wconn._filehTab.erase(foid);
wconn._mu.Unlock(); wconn._mu.Unlock();
} }
...@@ -745,7 +748,7 @@ error _FileH::close() { ...@@ -745,7 +748,7 @@ error _FileH::close() {
// decref open count; do real close only when last open goes away. // decref open count; do real close only when last open goes away.
if (fileh._nopen <= 0) if (fileh._nopen <= 0)
panic("BUG: fileh._nopen <= 0"); panic("BUG: fileh.close: fileh._nopen <= 0");
fileh._nopen--; fileh._nopen--;
if (fileh._nopen > 0) if (fileh._nopen > 0)
return nil; return nil;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment