aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoin.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-04-02 02:40:41 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2012-04-04 16:21:08 +0200
commit712fd182b72b0f5a1bcf843f171c29ec0a49b50f (patch)
treeac5edf9ece53a8f03fde992b0fbfa9a11c8db688 /src/qt/bitcoin.cpp
parentb0a7e05a45a925d78efd00ecca6dce9b7a9530f9 (diff)
downloadbitcoin-712fd182b72b0f5a1bcf843f171c29ec0a49b50f.tar.xz
Locking system overhaul, add condition variables
This commit simplifies the locking system: CCriticalSection becomes a simple typedef for boost::interprocess::interprocess_recursive_mutex, and CCriticalBlock and CTryCriticalBlock are replaced by a templated CMutexLock, which wraps boost::interprocess::scoped_lock. By making the lock type a template parameter, some critical sections can now be changed to non-recursive locks, which support waiting via condition variables. These are implemented in CWaitableCriticalSection and WAITABLE_CRITICAL_BLOCK. CWaitableCriticalSection is a wrapper for a different Boost mutex, which supports waiting/notification via condition variables. This should enable us to remove much of the used polling code. Important is that this mutex is not recursive, so functions that perform the locking must not call eachother. Because boost::interprocess::scoped_lock does not support assigning and copying, I had to revert to the older CRITICAL_BLOCK macros that use a nested for loop instead of a simple if.
Diffstat (limited to 'src/qt/bitcoin.cpp')
0 files changed, 0 insertions, 0 deletions