Bug #444 - Interactive undo locks pending.data and doesn't give it up

- flock() now uses LOCK_EX | LOCK_NB so it won't wait for the file lock
This commit is contained in:
Cory Donnelly 2010-07-26 14:02:37 -04:00
parent 3846954c42
commit 78edb61c4c

View file

@ -1504,7 +1504,7 @@ FILE* TDB::openAndLock (const std::string& file)
while (flock (fileno (in), LOCK_NB | LOCK_EX) && ++retry <= 3)
{
std::cout << "Waiting for file lock..." << std::endl;
while (flock (fileno (in), LOCK_EX) && ++retry <= 3)
while (flock (fileno (in), LOCK_NB | LOCK_EX) && ++retry <= 3)
delay (0.2);
}