Fix various issues found with thread sanitizer on macOS

This commit is contained in:
Wojtek Figat
2024-04-13 13:20:17 +02:00
parent 8144db8e13
commit 9c2c02c1cf
10 changed files with 70 additions and 75 deletions

View File

@@ -57,7 +57,7 @@ public:
/// <summary>
/// Locks the critical section.
/// </summary>
void Lock() const
NO_SANITIZE_THREAD void Lock() const
{
pthread_mutex_lock(_mutexPtr);
#if BUILD_DEBUG
@@ -69,7 +69,7 @@ public:
/// Attempts to enter a critical section without blocking. If the call is successful, the calling thread takes ownership of the critical section.
/// </summary>
/// <returns>True if calling thread took ownership of the critical section.</returns>
bool TryLock() const
NO_SANITIZE_THREAD bool TryLock() const
{
return pthread_mutex_trylock(_mutexPtr) == 0;
}
@@ -77,7 +77,7 @@ public:
/// <summary>
/// Releases the lock on the critical section.
/// </summary>
void Unlock() const
NO_SANITIZE_THREAD void Unlock() const
{
#if BUILD_DEBUG
((UnixCriticalSection*)this)->_owningThreadId = 0;