forked from facebook/rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Timer should run scheduled function without mutex (facebook#7228)
Summary: Timer (defined in timer.h) schedules and runs user-specified fuctions regularly. Current implementation holds the mutex while running user function, which will lead to contention and waiting. To fix, Timer::Run releases mutex before running user function, and re-acquires it afterwards. This fix will impact how we can cancel a task. If the task is running, it is not holding the mutex. The thread calling Cancel() should wait until the current task finishes. Test Plan (devserver): make check COMPILE_WITH_ASAN=1 make check Pull Request resolved: facebook#7228 Reviewed By: jay-zhuang Differential Revision: D23065487 Pulled By: riversand963 fbshipit-source-id: 07cb59741f506d3eb875c8ab90f73437568d3724
- Loading branch information
1 parent
e9daede
commit f15414b
Showing
2 changed files
with
133 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters