diff options
author | 2021-01-02 17:53:53 +0000 | |
---|---|---|
committer | 2021-01-02 17:53:53 +0000 | |
commit | 7dbc316582d286e5db313312e6dcefb33c1bf303 (patch) | |
tree | 7bdb2ea0889a40ab19fc2a1ad996de78d7853775 /lib/libunwind/src/RWMutex.hpp | |
parent | sync (diff) | |
download | wireguard-openbsd-7dbc316582d286e5db313312e6dcefb33c1bf303.tar.xz wireguard-openbsd-7dbc316582d286e5db313312e6dcefb33c1bf303.zip |
Remove libunwind 8.0.0 now that we switched to libunwind 11.0.0 in the
gnu/ directory.
Diffstat (limited to 'lib/libunwind/src/RWMutex.hpp')
-rw-r--r-- | lib/libunwind/src/RWMutex.hpp | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/lib/libunwind/src/RWMutex.hpp b/lib/libunwind/src/RWMutex.hpp deleted file mode 100644 index 50a78a57b08..00000000000 --- a/lib/libunwind/src/RWMutex.hpp +++ /dev/null @@ -1,77 +0,0 @@ -//===----------------------------- Registers.hpp --------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -// -// Abstract interface to shared reader/writer log, hiding platform and -// configuration differences. -// -//===----------------------------------------------------------------------===// - -#ifndef __RWMUTEX_HPP__ -#define __RWMUTEX_HPP__ - -#if defined(_WIN32) -#include <windows.h> -#elif !defined(_LIBUNWIND_HAS_NO_THREADS) -#include <pthread.h> -#endif - -namespace libunwind { - -#if defined(_LIBUNWIND_HAS_NO_THREADS) - -class _LIBUNWIND_HIDDEN RWMutex { -public: - bool lock_shared() { return true; } - bool unlock_shared() { return true; } - bool lock() { return true; } - bool unlock() { return true; } -}; - -#elif defined(_WIN32) - -class _LIBUNWIND_HIDDEN RWMutex { -public: - bool lock_shared() { - AcquireSRWLockShared(&_lock); - return true; - } - bool unlock_shared() { - ReleaseSRWLockShared(&_lock); - return true; - } - bool lock() { - AcquireSRWLockExclusive(&_lock); - return true; - } - bool unlock() { - ReleaseSRWLockExclusive(&_lock); - return true; - } - -private: - SRWLOCK _lock = SRWLOCK_INIT; -}; - -#else - -class _LIBUNWIND_HIDDEN RWMutex { -public: - bool lock_shared() { return pthread_rwlock_rdlock(&_lock) == 0; } - bool unlock_shared() { return pthread_rwlock_unlock(&_lock) == 0; } - bool lock() { return pthread_rwlock_wrlock(&_lock) == 0; } - bool unlock() { return pthread_rwlock_unlock(&_lock) == 0; } - -private: - pthread_rwlock_t _lock = PTHREAD_RWLOCK_INITIALIZER; -}; - -#endif - -} // namespace libunwind - -#endif // __RWMUTEX_HPP__ |