Index: webrtc/base/sigslot.cc |
diff --git a/webrtc/base/sigslot.cc b/webrtc/base/sigslot.cc |
index 9628217dc0729b0847c97a4567650beae235afd8..2fdb214b5200f76e4503c4aa4dd92fe250312696 100644 |
--- a/webrtc/base/sigslot.cc |
+++ b/webrtc/base/sigslot.cc |
@@ -12,43 +12,11 @@ namespace sigslot { |
#ifdef _SIGSLOT_HAS_POSIX_THREADS |
-multi_threaded_global::multi_threaded_global() { |
- pthread_mutex_init(get_mutex(), NULL); |
-} |
- |
-multi_threaded_global::multi_threaded_global(const multi_threaded_global&) { |
-} |
- |
-multi_threaded_global::~multi_threaded_global() = default; |
- |
-void multi_threaded_global::lock() { |
- pthread_mutex_lock(get_mutex()); |
-} |
- |
-void multi_threaded_global::unlock() { |
- pthread_mutex_unlock(get_mutex()); |
-} |
- |
-multi_threaded_local::multi_threaded_local() { |
- pthread_mutex_init(&m_mutex, NULL); |
-} |
- |
-multi_threaded_local::multi_threaded_local(const multi_threaded_local&) { |
- pthread_mutex_init(&m_mutex, NULL); |
-} |
- |
-multi_threaded_local::~multi_threaded_local() { |
- pthread_mutex_destroy(&m_mutex); |
-} |
- |
-void multi_threaded_local::lock() { |
- pthread_mutex_lock(&m_mutex); |
-} |
- |
-void multi_threaded_local::unlock() { |
- pthread_mutex_unlock(&m_mutex); |
+pthread_mutex_t* multi_threaded_global::get_mutex() { |
+ static pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER; |
+ return &g_mutex; |
} |
#endif // _SIGSLOT_HAS_POSIX_THREADS |
-}; // namespace sigslot |
+} // namespace sigslot |