aboutsummaryrefslogtreecommitdiff
path: root/src/sync.h
Commit message (Collapse)AuthorAgeFilesLines
* Clean up lockorder data of destroyed mutexesPieter Wuille2016-04-101-12/+21
| | | | | | | | | | | | | | | The lockorder potential deadlock detection works by remembering for each lock A that is acquired while holding another B the pair (A,B), and triggering a warning when (B,A) already exists in the table. A and B in the above text are represented by pointers to the CCriticalSection object that is acquired. This does mean however that we need to clean up the table entries that refer to any critical section which is destroyed, as it memory address can potentially be used for another unrelated lock in the future. Implement this clean up by remembering not only the pairs in forward direction, but also backward direction. This allows for fast iteration over all pairs that use a deleted CCriticalSection in either the first or the second position.
* Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
|
* typofixes (found by misspell_fixer)Veres Lajos2015-08-101-1/+1
|
* locking: teach Clang's -Wthread-safety to cope with our scoped lock macrosCory Fields2015-06-161-4/+4
| | | | | | | | This allows us to use function/variable/class attributes to specify locking requisites, allowing problems to be detected during static analysis. This works perfectly with newer Clang versions (tested with 3.3-3.7). For older versions (tested 3.2), it compiles fine but spews lots of false-positives.
* [Trivial] format sync.hPhilip Kaufmann2015-04-201-14/+9
|
* Removed main.h dependency from rpcserver.cppEric Lombrozo2015-01-281-0/+11
| | | | | | | | Rebased by @laanwj: - update for RPC methods added since 84d13ee: setmocktime, invalidateblock, reconsiderblock. Only the first, setmocktime, required a change, the other two are thread safe.
* Added "Core" to copyright headerssandakersmann2014-12-191-1/+1
| | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* Remove references to X11 licenceMichael Ford2014-12-161-1/+1
|
* Apply clang-format on some infrequently-updated filesPieter Wuille2014-09-191-30/+40
|
* add missing header end commentsPhilip Kaufmann2014-08-281-1/+1
| | | | | | - ensures a consistent usage in header files - also add a blank line after the copyright header where missing - also remove orphan new-lines at the end of some files
* getblocktemplate: longpolling supportLuke Dashjr2014-07-111-0/+3
|
* Use mutex pointer instead of name for AssertLockHeldWladimir J. van der Laan2013-12-191-2/+3
| | | | | This makes it useable for non-global locks such as the wallet and keystore locks.
* mutex debugging routines: LocksHeld() and AssertLockHeld()Gavin Andresen2013-11-291-0/+3
|
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-3/+5
| | | | | | | | | Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
* Bump Year Number to 2013super32013-10-201-1/+1
|
* Added comments to sync.h to make it easier to understand the macrosEric Lombrozo2013-06-251-0/+42
|
* Merge pull request #2003 from alexanderkjeldaas/documented-locking-part-2Gavin Andresen2012-12-121-2/+23
|\ | | | | Documented locking part 1+2
| * o Added AnnotatedMixin which adds locking annotations to the mutexAlexander Kjeldaas2012-11-111-2/+23
| | | | | | | | API, compatible with clang's -Wthread-safety
* | Simplify CMutexLockAlexander Kjeldaas2012-11-141-30/+10
|/ | | | | | | | | | | | | | | | | | | | | | | | | o Remove unused Leave and GetLock functions o Make Enter and TryEnter private. o Simplify Enter and TryEnter. boost::unique_lock doesn't really know whether the mutex it wraps is locked or not when the defer_lock option is used. The boost::recursive_mutex does not expose this information, so unique_lock only infers this knowledge. When taking the lock is defered, it (randomly) assumes that the lock is not taken. boost::unique_lock has the following definition: unique_lock(Mutex& m_,defer_lock_t): m(&m_),is_locked(false) {} bool owns_lock() const { return is_locked; } Thus it is a mistake to check owns_lock() in Enter and TryEnter - they will always return false.
* Update comment, we're no longer using boost::interprocess::scoped_lockWladimir J. van der Laan2012-09-251-1/+1
|
* Fix DEBUG_LOCKCONTENTIONMatt Corallo2012-06-051-2/+5
|
* Merge pull request #1354 from fanquake/masterPieter Wuille2012-05-201-1/+1
|\ | | | | Update Header Licenses
| * Update License in File HeadersFordy2012-05-181-1/+1
| | | | | | | | | | | | I originally created a pull to replace the "COPYING" in crypter.cpp and crypter.h, but it turned out that COPYING was actually the correct file.
* | Use boost::thread locking instead of interprocessPieter Wuille2012-05-181-42/+35
|/
* Split synchronization mechanisms from util.{h,cpp}Pieter Wuille2012-05-111-0/+216