summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/Mutex.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Clean up vestigial remnants of locking primitivesSaleem Abdulrasool2016-07-281-398/+0
| | | | | | | | | | | | | | | | This finally removes the use of the Mutex and Condition classes. This is an intricate patch as the Mutex and Condition classes were tied together. Furthermore, many places had slightly differing uses of time values. Convert timeout values to relative everywhere to permit the use of std::chrono::duration, which is required for the use of std::condition_variable's timeout. Adjust all Condition and related Mutex classes over to std::{,recursive_}mutex and std::condition_variable. This change primarily comes at the cost of breaking the TracingMutex which was based around the Mutex class. It would be possible to write a wrapper to provide similar functionality, but that is beyond the scope of this change. llvm-svn: 277011
* Disable mutex error checking so it doesn't create problems with the ↵Greg Clayton2015-07-231-1/+1
| | | | | | multi-threaded test case. The error would cause an assertion that could cause lldb to crash when unlocking a mutex returned an error because it was in use. llvm-svn: 243067
* Fixing warnings shouldn't introduce a crasher.Greg Clayton2014-07-181-1/+3
| | | | | | | | Fix the warning the correct way without making things crash when ENABLE_MUTEX_ERROR_CHECKING is non enabled. <rdar://problem/17703039> llvm-svn: 213394
* Cleanup/rearrange includes:Virgile Bello2013-08-281-1/+0
| | | | | | | - factorize unistd.h and stdbool.h in lldb-types.h. - Add <functional> and <string> where required. llvm-svn: 189477
* MingW compilation (windows). Includes various refactoring to improve ↵Virgile Bello2013-08-231-9/+16
| | | | | | portability. llvm-svn: 189107
* Fix various build warnings.Matt Kopec2013-06-031-0/+1
| | | | llvm-svn: 183140
* Fixed some linux buildbot warnings.Greg Clayton2013-04-191-2/+1
| | | | llvm-svn: 179892
* <rdar://problem/12446222>Enrico Granata2012-12-191-1/+34
| | | | | | | | | | | Implement the ability for Python commands to be interrupted by pressing CTRL+C Also add a new Mutex subclass that attempts to be helpful for debugging by logging actions performed on it FYI of all interested - there is a separate deadlocking issue related to how LLDB dispatches CTRL+C that might cause LLDB to deadlock upon pressing CTRL+C while in a Python command. This is not a regression, and was just previously masked by us not even trying to bail out of Python commands, so that it would not be clear from a user perspective whether we were deadlocked or stuck in an inconsistent state within the Python interpreter. llvm-svn: 170612
* More Linux warnings fixes (remove default labels as needed):Daniel Malea2012-12-071-4/+0
| | | | | | | | - as per http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations Patch by Matt Kopec! llvm-svn: 169633
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-291-4/+4
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* Fixed errors and warnings on debug code.Filipe Cabecinhas2012-07-091-4/+4
| | | | llvm-svn: 159929
* Change the Mutex::Locker class so that it takes the Mutex object and locks ↵Jim Ingham2012-06-081-71/+60
| | | | | | | | | | | | | | it, rather than being given the pthread_mutex_t from the Mutex and locks that. That allows us to track ownership of the Mutex better. Used this to switch the LLDB_CONFIGURATION_DEBUG enabled assert when we can't get the gdb-remote sequence mutex to assert when the thread that had the mutex releases it. This is generally more useful information than saying just who failed to get it (since the code that had it locked often had released it by the time the assert fired.) llvm-svn: 158240
* Don't expose the pthread_mutex_t underlying the Mutex & Mutex::Locker classes. Jim Ingham2012-05-041-15/+8
| | | | | | | | | | | | | No one was using it and Locker(pthread_mutex_t *) immediately asserts for pthread_mutex_t's that don't come from a Mutex anyway. Rather than try to make that work, we should maintain the Mutex abstraction and not pass around the platform implementation... Make Mutex::Locker::Lock take a Mutex & or a Mutex *, and remove the constructor taking a pthread_mutex_t *. You no longer need to call Mutex::GetMutex to pass your mutex to a Locker (you can't in fact, since I made it private.) llvm-svn: 156221
* Fix a think in Mutex::Locker::Locker(pthread_mutex_t *) Really should lock ↵Jim Ingham2012-05-041-2/+1
| | | | | | | | | the mutex handed in, not the m_mutex_ptr that you've set to NULL... Rework the Host.cpp::ThreadNameAccessor to use ThreadSafeSTLMap - we've got it so we might as well use it. Also works around a problem with the Mutex::Locker class raising fallacious asserts in debug mode when used with pthread_mutex_t's that weren't backed by Mutex objects. llvm-svn: 156193
* Made sure that the collections of mutexes used inSean Callanan2012-04-141-2/+2
| | | | | | | | checking for LLDB mutex validity are static so that entries put in there actually persist between calls to error_check_mutex. llvm-svn: 154727
* In debug mode, assert if we haven't initialized a mutex we thought we'd ↵Jim Ingham2012-04-131-0/+1
| | | | | | initialized. llvm-svn: 154710
* Added more complete error checking for mutexes only for "Debug" builds where ↵Greg Clayton2012-04-131-1/+82
| | | | | | we always check if a mutex is valid prior to doing stuff with it. We also track when mutexes are initialized and destroyed and keep these in sets that can very subsequent pthread_mutex_XXX API calls. llvm-svn: 154637
* No functionality changes, mostly cleanup.Greg Clayton2012-04-111-16/+26
| | | | | | | | Cleaned up the Mutex::Locker and the ReadWriteLock classes a bit. Also cleaned up the GDBRemoteCommunication class to not have so many packet functions. Used the "NoLock" versions of send/receive packet functions when possible for a bit of performance. llvm-svn: 154458
* Fix typo.Johnny Chen2012-01-271-1/+1
| | | | llvm-svn: 149140
* Enable extra error checking for debug builds in our mutexes byGreg Clayton2012-01-271-0/+36
| | | | | | | | | | watching for errors from pthread_mutex_destroy () (usually "Resource busy" errors for when you have a mutex locked and try to destroy it), and pthread_mutex_lock, and pthread_mutex_unlock (usually for trying to lock an invalid mutex that might have possible already been freed). llvm-svn: 149135
* Spelling changes applied from lldb_spelling.diffs from Bruce Mitchener.Greg Clayton2011-01-081-1/+1
| | | | | | Thanks Bruce! llvm-svn: 123083
* Patch from Jay Cornwall that modifies the LLDB "Host" layer to reuse moreGreg Clayton2010-09-071-0/+252
code between linux, darwin and BSD. llvm-svn: 113263
OpenPOWER on IntegriCloud