Lines Matching full:mutex
51 // LockLevel is used to impose a lock hierarchy [1] where acquisition of a Mutex at a higher or
140 // Base class for all Mutex implementations
184 // Number of times the Mutex has been contended.
202 // A Mutex is used to achieve mutual exclusion between threads. A Mutex can be used to gain
203 // exclusive access to what it guards. A Mutex can be in one of two states:
212 // * Mutex is not reentrant and so an attempt to ExclusiveLock on the same thread will result in
214 std::ostream& operator<<(std::ostream& os, const Mutex& mu);
215 class LOCKABLE Mutex : public BaseMutex {
217 explicit Mutex(const char* name, LockLevel level = kDefaultMutexLevel, bool recursive = false);
218 ~Mutex();
222 // Block until mutex is free then acquire exclusive access.
234 // Is the current thread the exclusive holder of the Mutex.
237 // Assert that the Mutex is exclusively held by the current thread.
245 // Assert that the Mutex is not held by the current thread.
259 // Returns how many times this Mutex has been locked, it is better to use AssertHeld/NotHeld.
267 const Mutex& operator!() const { return *this; }
284 DISALLOW_COPY_AND_ASSIGN(Mutex);
287 // A ReaderWriterMutex is used to achieve mutual exclusion between threads, similar to a Mutex.
288 // Unlike a Mutex a ReaderWriterMutex can be used to gain exclusive (writer) or shared (reader)
289 // access to what it guards. A flaw in relation to a Mutex is that it cannot be used with a
396 // Exclusive owner. Modification guarded by this mutex.
410 // Locks::mutator_lock_ mutex. The behaviour is identical to the ReaderWriterMutex except that
417 // transitions are consistent with the permitted behaviour of the mutex.
420 // suspended states before exclusive ownership of the mutator mutex is sought.
446 ConditionVariable(const char* name, Mutex& mutex);
451 // TODO: No thread safety analysis on Wait and TimedWait as they call mutex operations via their
462 // The Mutex being used by waiters. It is an error to mix condition variables between different
464 Mutex& guard_;
467 // their Mutex and another thread takes it and signals, the waiting thread observes that sequence_
480 // Scoped locker/unlocker for a regular Mutex that acquires mu upon construction and releases it
484 MutexLock(Thread* self, Mutex& mu) ACQUIRE(mu) : self_(self), mu_(mu) {
494 Mutex& mu_;
561 static Mutex* instrument_entrypoints_lock_;
604 static Mutex* runtime_shutdown_lock_ ACQUIRED_AFTER(heap_bitmap_lock_);
607 static Mutex* profiler_lock_ ACQUIRED_AFTER(runtime_shutdown_lock_);
610 static Mutex* trace_lock_ ACQUIRED_AFTER(profiler_lock_);
613 static Mutex* alloc_tracker_lock_ ACQUIRED_AFTER(trace_lock_);
618 static Mutex* deoptimization_lock_ ACQUIRED_AFTER(alloc_tracker_lock_);
621 static Mutex* interpreter_string_init_map_lock_ ACQUIRED_AFTER(deoptimization_lock_);
625 static Mutex* thread_list_lock_ ACQUIRED_AFTER(interpreter_string_init_map_lock_);
631 static Mutex* jni_libraries_lock_ ACQUIRED_AFTER(thread_list_lock_);
639 // When declaring any Mutex add DEFAULT_MUTEX_ACQUIRED_AFTER to use annotalysis to check the code
640 // doesn't try to hold a higher level Mutex.
643 static Mutex* allocated_monitor_ids_lock_ ACQUIRED_AFTER(classlinker_classes_lock_);
646 static Mutex* allocated_thread_ids_lock_ ACQUIRED_AFTER(allocated_monitor_ids_lock_);
649 static Mutex* modify_ldt_lock_ ACQUIRED_AFTER(allocated_thread_ids_lock_);
655 static Mutex* host_dlopen_handles_lock_ ACQUIRED_AFTER(oat_file_manager_lock_);
658 static Mutex* intern_table_lock_ ACQUIRED_AFTER(host_dlopen_handles_lock_);
661 static Mutex* reference_processor_lock_ ACQUIRED_AFTER(intern_table_lock_);
664 static Mutex* reference_queue_cleared_references_lock_ ACQUIRED_AFTER(reference_processor_lock_);
667 static Mutex* reference_queue_weak_references_lock_ ACQUIRED_AFTER(reference_queue_cleared_references_lock_);
670 static Mutex* reference_queue_finalizer_references_lock_ ACQUIRED_AFTER(reference_queue_weak_references_lock_);
673 static Mutex* reference_queue_phantom_references_lock_ ACQUIRED_AFTER(reference_queue_finalizer_references_lock_);
676 static Mutex* reference_queue_soft_references_lock_ ACQUIRED_AFTER(reference_queue_phantom_references_lock_);
679 static Mutex* abort_lock_ ACQUIRED_AFTER(reference_queue_soft_references_lock_);
683 static Mutex* thread_suspend_count_lock_ ACQUIRED_AFTER(abort_lock_);
686 static Mutex* unexpected_signal_lock_ ACQUIRED_AFTER(thread_suspend_count_lock_);
689 static Mutex* mem_maps_lock_ ACQUIRED_AFTER(unexpected_signal_lock_);
692 static Mutex* logging_lock_ ACQUIRED_AFTER(unexpected_signal_lock_);
695 // TODO: this should be a RW mutex lock, except that ConditionVariables don't work with it.
696 static Mutex* lambda_table_lock_ ACQUIRED_AFTER(mutator_lock_);