flutter_flutter/fml/synchronization/count_down_latch.h
liyuqian 7f4f52f952
Add missing ifndef guard for count_down_latch.h (#9143)
I discovered this while experimenting with the timing API.
2019-05-30 14:17:08 -07:00

35 lines
743 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_COUNT_DOWN_LATCH_H_
#define FLUTTER_FML_SYNCHRONIZATION_COUNT_DOWN_LATCH_H_
#include <atomic>
#include "flutter/fml/macros.h"
#include "flutter/fml/synchronization/waitable_event.h"
namespace fml {
class CountDownLatch {
public:
CountDownLatch(size_t count);
~CountDownLatch();
void Wait();
void CountDown();
private:
std::atomic_size_t count_;
ManualResetWaitableEvent waitable_event_;
FML_DISALLOW_COPY_AND_ASSIGN(CountDownLatch);
};
} // namespace fml
#endif // FLUTTER_FML_SYNCHRONIZATION_COUNT_DOWN_LATCH_H_