mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
* Revert "Revert "Guard the service protocol's global handlers list with a reader/writer lock (#6888) #6895" (#6899)" This reverts commit b6e93759faa92a96650e326b0e82578a6803c46d and applies fix for tests on Windows. * Reland guard the service protocol's global handlers list with a reader/writer lock. * Remove blank line
30 lines
740 B
C++
30 lines
740 B
C++
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef FLUTTER_FML_SYNCHRONIZATION_SHARED_MUTEX_STD_H_
|
|
#define FLUTTER_FML_SYNCHRONIZATION_SHARED_MUTEX_STD_H_
|
|
|
|
#include <shared_mutex>
|
|
#include "flutter/fml/synchronization/shared_mutex.h"
|
|
|
|
namespace fml {
|
|
|
|
class SharedMutexStd : public SharedMutex {
|
|
public:
|
|
virtual void Lock();
|
|
virtual void LockShared();
|
|
virtual void Unlock();
|
|
virtual void UnlockShared();
|
|
|
|
private:
|
|
friend SharedMutex* SharedMutex::Create();
|
|
SharedMutexStd() = default;
|
|
|
|
std::shared_timed_mutex mutex_;
|
|
};
|
|
|
|
} // namespace fml
|
|
|
|
#endif // FLUTTER_FML_SYNCHRONIZATION_SHARED_MUTEX_STD_H_
|