ion/base/lockguards.h
// Locks the mutex if it is not already locked by this guard. This function
// blocks if the mutex is locked elsewhere (e.g., by another guard).
Locks the mutex if it is not already locked by this guard. This function
blocks if the mutex is locked elsewhere .
Locks the mutex if it is not already locked by this guard . This function blocks if the mutex is locked elsewhere .
void Lock() {
    if (!is_locked_) {
      mutex_.Lock();
      is_locked_ = true;
    }
  }
void Lock ( ) { if ( ! is_locked_ ) { mutex_ . Lock ( ) ; is_locked_ = true ; } }
Locks the mutex if it is not already locked by this guard.
Locks the mutex if it is not already locked by this guard .