Home | History | Annotate | Download | only in utils

Lines Matching refs:Mutex

204  * Simple mutex class.  The implementation is system-dependent.
206 * The mutex must be unlocked by the thread that locked it. They are not
209 class Mutex {
216 Mutex();
217 Mutex(const char* name);
218 Mutex(int type, const char* name = NULL);
219 ~Mutex();
221 // lock or unlock the mutex
228 // Manages the mutex automatically. It'll be locked when Autolock is
232 inline Autolock(Mutex& mutex) : mLock(mutex) { mLock.lock(); }
233 inline Autolock(Mutex* mutex) : mLock(*mutex) { mLock.lock(); }
236 Mutex& mLock;
242 // A mutex cannot be copied
243 Mutex(const Mutex&);
244 Mutex& operator = (const Mutex&);
256 inline Mutex::Mutex() {
259 inline Mutex::Mutex(const char* name) {
262 inline Mutex::Mutex(int type, const char* name) {
273 inline Mutex::~Mutex() {
276 inline status_t Mutex::lock() {
279 inline void Mutex::unlock() {
282 inline status_t Mutex::tryLock() {
289 * Automatic mutex. Declare one of these at the top of a function.
291 * mutex.
294 typedef Mutex::Autolock AutoMutex;
301 * Simple mutex class. The implementation is system-dependent.
303 * The mutex must be unlocked by the thread that locked it. They are not
391 * Condition variables are paired up with mutexes. Lock the mutex,
393 * or unlock the mutex and continue. All threads calling wait() must
394 * use the same mutex for a given Condition.
406 // Wait on the condition variable. Lock the mutex before calling.
407 status_t wait(Mutex& mutex);
409 status_t waitRelative(Mutex& mutex, nsecs_t reltime);
442 inline status_t Condition::wait(Mutex& mutex) {
443 return -pthread_cond_wait(&mCond, &mutex.mMutex);
445 inline status_t Condition::waitRelative(Mutex& mutex, nsecs_t reltime) {
450 return -pthread_cond_timedwait_relative_np(&mCond, &mutex.mMutex, &ts);
468 return -pthread_cond_timedwait(&mCond, &mutex.mMutex, &ts);
530 Mutex mLock;