Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
thread_macos.h
Go to the documentation of this file.
1// Copyright (c) 2012, 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_MACOS_H_
6#define RUNTIME_BIN_THREAD_MACOS_H_
7
8#if !defined(RUNTIME_BIN_THREAD_H_)
9#error Do not include thread_macos.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
17namespace dart {
18namespace bin {
19
20typedef pthread_t ThreadId;
21
22class MutexData {
23 private:
24 MutexData() {}
25 ~MutexData() {}
26
27 pthread_mutex_t* mutex() { return &mutex_; }
28
29 pthread_mutex_t mutex_;
30
31 friend class Mutex;
32
34 DISALLOW_COPY_AND_ASSIGN(MutexData);
35};
36
37class MonitorData {
38 private:
39 MonitorData() {}
40 ~MonitorData() {}
41
42 pthread_mutex_t* mutex() { return &mutex_; }
43 pthread_cond_t* cond() { return &cond_; }
44
45 pthread_mutex_t mutex_;
46 pthread_cond_t cond_;
47
48 friend class Monitor;
49
51 DISALLOW_COPY_AND_ASSIGN(MonitorData);
52};
53
54} // namespace bin
55} // namespace dart
56
57#endif // RUNTIME_BIN_THREAD_MACOS_H_
friend class Mutex
Definition thread_absl.h:32
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