Lines Matching full:mutex
17 #include "mutex.h"
27 #include "mutex-inl.h"
34 Mutex* Locks::abort_lock_ = nullptr;
35 Mutex* Locks::alloc_tracker_lock_ = nullptr;
36 Mutex* Locks::allocated_monitor_ids_lock_ = nullptr;
37 Mutex* Locks::allocated_thread_ids_lock_ = nullptr;
40 Mutex* Locks::deoptimization_lock_ = nullptr;
42 Mutex* Locks::instrument_entrypoints_lock_ = nullptr;
43 Mutex* Locks::intern_table_lock_ = nullptr;
44 Mutex* Locks::interpreter_string_init_map_lock_ = nullptr;
45 Mutex* Locks::jni_libraries_lock_ = nullptr;
46 Mutex* Locks::logging_lock_ = nullptr;
47 Mutex* Locks::mem_maps_lock_ = nullptr;
48 Mutex* Locks::modify_ldt_lock_ = nullptr;
50 Mutex* Locks::profiler_lock_ = nullptr;
52 Mutex* Locks::host_dlopen_handles_lock_ = nullptr;
53 Mutex* Locks::reference_processor_lock_ = nullptr;
54 Mutex* Locks::reference_queue_cleared_references_lock_ = nullptr;
55 Mutex* Locks::reference_queue_finalizer_references_lock_ = nullptr;
56 Mutex* Locks::reference_queue_phantom_references_lock_ = nullptr;
57 Mutex* Locks::reference_queue_soft_references_lock_ = nullptr;
58 Mutex* Locks::reference_queue_weak_references_lock_ = nullptr;
59 Mutex* Locks::runtime_shutdown_lock_ = nullptr;
60 Mutex* Locks::thread_list_lock_ = nullptr;
62 Mutex* Locks::thread_suspend_count_lock_ = nullptr;
63 Mutex* Locks::trace_lock_ = nullptr;
64 Mutex* Locks::unexpected_signal_lock_ = nullptr;
65 Mutex* Locks::lambda_table_lock_ = nullptr;
69 // A guard for all_mutexes_ that's not a mutex (Mutexes must CAS to acquire and busy wait).
95 explicit ScopedAllMutexesLock(const BaseMutex* mutex) : mutex_(mutex) {
96 while (!gAllMutexData->all_mutexes_guard.CompareExchangeWeakAcquire(0, mutex)) {
119 ScopedContentionRecorder(BaseMutex* mutex, uint64_t blocked_tid, uint64_t owner_tid)
120 : mutex_(kLogLockContentions ? mutex : nullptr),
126 mutex->GetName(), owner_tid);
168 os << "Mutex logging:\n";
178 BaseMutex* mutex = *it;
179 if (mutex->HasEverContended()) {
180 mutex->Dump(os);
186 BaseMutex* mutex = *it;
187 if (!mutex->HasEverContended()) {
188 mutex->Dump(os);
202 << "Waiting on unacquired mutex: " << name_;
315 Mutex::Mutex(const char* name, LockLevel level, bool recursive)
332 Mutex::~Mutex() {
336 LOG(shutting_down ? WARNING : FATAL) << "destroying mutex with owner: " << exclusive_owner_;
339 LOG(shutting_down ? WARNING : FATAL) << "unexpectedly found an owner on unlocked mutex "
343 LOG(shutting_down ? WARNING : FATAL) << "unexpectedly found a contender on mutex " << name_;
352 // TODO: should we just not log at all if shutting down? this could be the logging mutex!
359 void Mutex::ExclusiveLock(Thread* self) {
396 CHECK(recursion_count_ == 1 || recursive_) << "Unexpected recursion count on mutex: "
402 bool Mutex::ExclusiveTryLock(Thread* self) {
436 CHECK(recursion_count_ == 1 || recursive_) << "Unexpected recursion count on mutex: "
443 void Mutex::ExclusiveUnlock(Thread* self) {
461 CHECK(recursion_count_ == 0 || recursive_) << "Unexpected recursion count on mutex: "
502 void Mutex::Dump(std::ostream& os) const {
511 std::ostream& operator<<(std::ostream& os, const Mutex& mu) {
540 // TODO: should we just not log at all if shutting down? this could be the logging mutex!
749 ConditionVariable::ConditionVariable(const char* name, Mutex& guard)
798 // Requeue waiters onto mutex. The waiter holds the contender count on the mutex high ensuring
799 // mutex unlocks will awaken the requeued waiter thread.
821 // Futex wake 1 waiter who will then come and in contend on mutex. It'd be nice to requeue them
843 // Ensure the Mutex is contended so that requeued threads are awoken.
894 // Ensure the Mutex is contended so that requeued threads are awoken.
971 instrument_entrypoints_lock_ = new Mutex("instrument entrypoint lock", current_lock_level);
992 trace_lock_ = new Mutex("trace lock", current_lock_level);
996 runtime_shutdown_lock_ = new Mutex("runtime shutdown lock", current_lock_level);
1000 profiler_lock_ = new Mutex("profiler lock", current_lock_level);
1004 deoptimization_lock_ = new Mutex("Deoptimization lock", current_lock_level);
1008 alloc_tracker_lock_ = new Mutex("AllocTracker lock", current_lock_level);
1012 thread_list_lock_ = new Mutex("thread list lock", current_lock_level);
1016 jni_libraries_lock_ = new Mutex("JNI shared libraries map lock", current_lock_level);
1029 allocated_monitor_ids_lock_ = new Mutex("allocated monitor ids lock", current_lock_level);
1033 allocated_thread_ids_lock_ = new Mutex("allocated thread ids lock", current_lock_level);
1038 modify_ldt_lock_ = new Mutex("modify_ldt lock", current_lock_level);
1047 host_dlopen_handles_lock_ = new Mutex("host dlopen handles lock", current_lock_level);
1051 intern_table_lock_ = new Mutex("InternTable lock", current_lock_level);
1055 reference_processor_lock_ = new Mutex("ReferenceProcessor lock", current_lock_level);
1059 reference_queue_cleared_references_lock_ = new Mutex("ReferenceQueue cleared references lock", current_lock_level);
1063 reference_queue_weak_references_lock_ = new Mutex("ReferenceQueue cleared references lock", current_lock_level);
1067 reference_queue_finalizer_references_lock_ = new Mutex("ReferenceQueue finalizer references lock", current_lock_level);
1071 reference_queue_phantom_references_lock_ = new Mutex("ReferenceQueue phantom references lock", current_lock_level);
1075 reference_queue_soft_references_lock_ = new Mutex("ReferenceQueue soft references lock", current_lock_level);
1079 lambda_table_lock_ = new Mutex("lambda table lock", current_lock_level);
1083 abort_lock_ = new Mutex("abort lock", current_lock_level, true);
1087 thread_suspend_count_lock_ = new Mutex("thread suspend count lock", current_lock_level);
1091 unexpected_signal_lock_ = new Mutex("unexpected signal lock", current_lock_level, true);
1095 mem_maps_lock_ = new Mutex("mem maps lock", current_lock_level);
1099 logging_lock_ = new Mutex("logging lock", current_lock_level, true);