From 3121b799a96fccc40ffe079aaaeece44c6802595 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 14 Feb 2024 10:46:13 +0000 Subject: [PATCH] cannot rely on pthread_self() when thread-based coros in use --- googletest/include/gtest/internal/gtest-port.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h index fa457b788..ef61ec23a 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -1684,8 +1684,8 @@ class MutexBase { // Does nothing if the current thread holds the mutex. Otherwise, crashes // with high probability. void AssertHeld() const { - GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self())) - << "The current thread is not holding the mutex @" << this; + GTEST_CHECK_(has_owner_) + << "No thread is holding the mutex @" << this; } // A static mutex may be used before main() is entered. It may even