Home | History | Annotate | Download | only in utils

Lines Matching full:mutex

40  * doesn't build for Win32 should use std::mutex and std::lock_guard instead.
42 * Simple mutex class. The implementation is system-dependent.
44 * The mutex must be unlocked by the thread that locked it. They are not
47 class Mutex {
54 Mutex();
55 Mutex(const char* name);
56 Mutex(int type, const char* name = NULL);
57 ~Mutex();
59 // lock or unlock the mutex
67 // Lock the mutex, but don't wait longer than timeoutNs (relative time).
81 // Manages the mutex automatically. It'll be locked when Autolock is
85 inline Autolock(Mutex& mutex) : mLock(mutex) { mLock.lock(); }
86 inline Autolock(Mutex* mutex) : mLock(*mutex) { mLock.lock(); }
89 Mutex& mLock;
95 // A mutex cannot be copied
96 Mutex(const Mutex&);
97 Mutex& operator = (const Mutex&);
111 inline Mutex::Mutex() {
114 inline Mutex::Mutex(__attribute__((unused)) const char* name) {
117 inline Mutex::Mutex(int type, __attribute__((unused)) const char* name) {
128 inline Mutex::~Mutex() {
131 inline status_t Mutex::lock() {
134 inline void Mutex::unlock() {
137 inline status_t Mutex::tryLock() {
141 inline status_t Mutex::timedLock(nsecs_t timeoutNs) {
156 * Automatic mutex. Declare one of these at the top of a function.
158 * mutex.
161 typedef Mutex::Autolock AutoMutex;