6 ms·
fixed your link: https://github.com/facebook/rocksdb/blob/master/db/db_impl.cc#L1665 https://github.com/facebook/rocksdb/blob/master/db/db_impl.c... Take anoth
by tsewlliw 13y ago
fixed your link: https://github.com/facebook/rocksdb/blob/master/db/db_impl.cc#L1665 https://github.com/facebook/rocksdb/blob/master/db/db_impl.c...
Take another look! There's a guard object used at the function scope to ensure the lock is released, and this block is bracketed to release and reacquire the lock, not acquire and release. There may be a case for a guard object that does the release/reacquire, but its definitely not a slam dunk like acquire/release
- phunge 13y agoStill, that's not exception-safe, correct? If LogFlush or SleepForMicroseconds throws an exception the mutex will be unlocked twice, which pthreads disallows for normal mutexes...
- deleted 13y ago[deleted]
- cbsmith 13y agoYou know, for a second I thought you were wrong, but I changed my mind. This does look like a bug, and a simple on to avoid at that. It's tough, because Rocks is still highly based on LevelDB, which conforms to Google's coding style guideline, which makes RAII more than a bit tricky to do right.