1 // Copyright 2013 The Flutter Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef FLUTTER_FML_SYNCHRONIZATION_SHARED_MUTEX_POSIX_H_ 6 #define FLUTTER_FML_SYNCHRONIZATION_SHARED_MUTEX_POSIX_H_ 7 8 #include <shared_mutex> 9 #include "flutter/fml/synchronization/shared_mutex.h" 10 11 namespace fml { 12 13 class SharedMutexPosix : public SharedMutex { 14 public: 15 virtual void Lock(); 16 virtual void LockShared(); 17 virtual void Unlock(); 18 virtual void UnlockShared(); 19 20 private: 21 friend SharedMutex* SharedMutex::Create(); 22 SharedMutexPosix(); 23 24 pthread_rwlock_t rwlock_; 25 }; 26 27 } // namespace fml 28 29 #endif // FLUTTER_FML_SYNCHRONIZATION_SHARED_MUTEX_POSIX_H_ 30