Fix data races caused by incorrect locking (#1668)

Found via Threadsanitizer.  Fixes #1471.
This commit is contained in:
Andrew Gaul
2021-05-29 00:11:55 +09:00
committed by GitHub
parent 9bf525ee7a
commit 84174c560d
4 changed files with 18 additions and 18 deletions

View File

@ -512,7 +512,7 @@ FdEntity* FdManager::Open(const char* path, headers_t* pmeta, off_t size, time_t
}
// open
if(0 != ent->Open(pmeta, size, time, no_fd_lock_wait)){
if(0 != ent->Open(pmeta, size, time, no_fd_lock_wait ? AutoLock::NO_WAIT : AutoLock::NONE)){
if(close){
ent->Close();
}