Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
thread_absl.h
Go to the documentation of this file.
1// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_BIN_THREAD_ABSL_H_
6#define RUNTIME_BIN_THREAD_ABSL_H_
7
8#if !defined(RUNTIME_BIN_THREAD_H_)
9#error Do not include thread_absl.h directly; use thread.h instead.
10#endif
11
12#include <pthread.h>
13
14#include "platform/assert.h"
15#include "platform/globals.h"
16#include "third_party/absl/synchronization/mutex.h"
17
18namespace dart {
19namespace bin {
20
21typedef pthread_t ThreadId;
22
23class MutexData {
24 private:
25 MutexData() : mutex_() {}
26 ~MutexData() {}
27
28 absl::Mutex* mutex() { return &mutex_; }
29
30 absl::Mutex mutex_;
31
32 friend class Mutex;
33
36};
37
39 private:
40 MonitorData() : mutex_(), cond_() {}
41 ~MonitorData() {}
42
43 absl::Mutex* mutex() { return &mutex_; }
44 absl::CondVar* cond() { return &cond_; }
45
46 absl::Mutex mutex_;
47 absl::CondVar cond_;
48
49 friend class Monitor;
50
53};
54
55} // namespace bin
56} // namespace dart
57
58#endif // RUNTIME_BIN_THREAD_ABSL_H_
pthread_t ThreadId
Definition thread_absl.h:21
#define DISALLOW_ALLOCATION()
Definition globals.h:604
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition globals.h:581