Lines Matching defs:mutex

1203 // MutexBase and Mutex implement mutex on pthreads-based platforms. They
1206 // Mutex mutex;
1208 // MutexLock lock(&mutex); // Acquires the mutex and releases it at the end
1213 // the following to define a static mutex:
1217 // You can forward declare a static mutex like this:
1221 // To create a dynamic mutex, just define an object of type Mutex.
1224 // Acquires this mutex.
1230 // Releases this mutex.
1234 // mutex when this is called.
1239 // Does nothing if the current thread holds the mutex. Otherwise, crashes
1243 << "The current thread is not holding the mutex @" << this;
1246 // A static mutex may be used before main() is entered. It may even
1248 // must be able to initialize a static mutex object at link time.
1252 pthread_mutex_t mutex_; // The underlying pthread mutex.
1253 pthread_t owner_; // The thread holding the mutex; 0 means no one holds it.
1256 // Forward-declares a static mutex.
1257 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
1258 extern ::testing::internal::MutexBase mutex
1260 // Defines and statically (i.e. at link time) initializes a static mutex.
1261 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
1262 ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, 0 }
1285 explicit GTestMutexLock(MutexBase* mutex)
1286 : mutex_(mutex) { mutex_->Lock(); }
1412 // A dummy implementation of synchronization primitives (mutex, lock,
1414 // mutex is not supported - using Google Test in multiple threads is not
1423 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
1424 extern ::testing::internal::Mutex mutex
1426 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex