MCPcopy Create free account
hub / github.com/apache/singa / AssertHeld

Method AssertHeld

test/gtest/gtest.h:2464–2467  ·  view source on GitHub ↗

Does nothing if the current thread holds the mutex. Otherwise, crashes with high probability.

Source from the content-addressed store, hash-verified

2462 // Does nothing if the current thread holds the mutex. Otherwise, crashes
2463 // with high probability.
2464 void AssertHeld() const {
2465 GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
2466 << "The current thread is not holding the mutex @" << this;
2467 }
2468
2469 // A static mutex may be used before main() is entered. It may even
2470 // be used before the dynamic initialization stage. Therefore we

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected