Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
thread_stack_resource.h
Go to the documentation of this file.
1// Copyright (c) 2019, 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_VM_THREAD_STACK_RESOURCE_H_
6#define RUNTIME_VM_THREAD_STACK_RESOURCE_H_
7
8#include <type_traits>
9#include <utility>
10
11#include "vm/allocation.h"
12#include "vm/globals.h"
13
14namespace dart {
15
16class Isolate;
17class IsolateGroup;
18class ThreadState;
19class Thread;
20
22 public:
24 : StackResource(reinterpret_cast<ThreadState*>(T)) {}
25
27
28 Thread* thread() const {
29 return reinterpret_cast<Thread*>(StackResource::thread());
30 }
31 Isolate* isolate() const;
33};
34
35template <typename T, typename... Args>
37 public:
38 static_assert(!std::is_base_of<StackResource, T>::value);
41 member_(thread, std::forward<Args>(args)...) {}
43
44 private:
45 T member_;
46};
47
48} // namespace dart
49
50#endif // RUNTIME_VM_THREAD_STACK_RESOURCE_H_
AsThreadStackResource(Thread *thread, Args &&... args)
ThreadState * thread() const
Definition allocation.h:33
IsolateGroup * isolate_group() const
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
Definition ref_ptr.h:256
#define T