Commit graph

9 commits

Author SHA1 Message Date
Gavin Andresen 8a7277a578 Merge pull request #2003 from alexanderkjeldaas/documented-locking-part-2
Documented locking part 1+2
2012-12-12 09:27:35 -08:00
Alexander Kjeldaas bfc9620799 Simplify CMutexLock
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.
2012-11-14 00:00:23 -03:00
Alexander Kjeldaas 05f97d1263 o Added AnnotatedMixin which adds locking annotations to the mutex
API, compatible with clang's -Wthread-safety
2012-11-11 00:55:48 -03:00
Wladimir J. van der Laan 4d369ec30c Update comment, we're no longer using boost::interprocess::scoped_lock 2012-09-25 12:16:37 +02:00
Matt Corallo 4d009243cb Fix DEBUG_LOCKCONTENTION 2012-06-05 16:13:16 +02:00
Pieter Wuille 46784d0826 Merge pull request #1354 from fanquake/master
Update Header Licenses
2012-05-20 12:27:50 -07:00
Pieter Wuille 660ff174f2 Use boost::thread locking instead of interprocess 2012-05-18 16:56:12 +02:00
Fordy 3a25a2b9b0 Update License in File Headers
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.
2012-05-18 22:02:28 +08:00
Pieter Wuille 7f3ccb59da Split synchronization mechanisms from util.{h,cpp} 2012-05-11 18:13:51 +02:00