Lines Matching refs:lock
267 static Lock lock;
309 lock.lock();
311 lock.unlock();
319 lock.lock();
322 lock.unlock();
444 // 1-0 state lock state (0, 1 or 2)
577 * the lock state field.
599 // An atomic_exchange is used to compete with other threads for the lock.
600 // If it returns unlocked, we have acquired the lock, otherwise another
601 // thread still holds the lock and we should wait again.
602 // If lock is acquired, an acquire fence is needed to make all memory accesses
616 * that we are in fact the owner of this lock.
623 // We use an atomic_exchange to release the lock. If locked_contended state
624 // is returned, some threads is waiting for the lock and we need to wake up
627 // lock owner threads.
637 // call whenever a lock is contended, but let us avoid forgetting anyone
640 // It's possible for another thread to sneak in and grab the lock between
642 // and holds the lock for a while, we'll wake up a sleeper, which will swap
643 // in locked_uncontended state and then go back to sleep since the lock is
660 // Detect recursive lock overflow and return EAGAIN.
811 // Avoid slowing down fast path of normal mutex lock operation.
879 // lock owner threads.
923 // lock if it is released / not owned by anyone. No need for a complex loop.