Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: runtime/vm/thread_interrupter.h

Issue 1275353005: VM thread shutdown. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/service_isolate.cc ('k') | runtime/vm/thread_interrupter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_THREAD_INTERRUPTER_H_ 5 #ifndef VM_THREAD_INTERRUPTER_H_
6 #define VM_THREAD_INTERRUPTER_H_ 6 #define VM_THREAD_INTERRUPTER_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/signal_handler.h" 9 #include "vm/signal_handler.h"
10 #include "vm/os_thread.h" 10 #include "vm/os_thread.h"
(...skipping 22 matching lines...) Expand all
33 static void Unregister(); 33 static void Unregister();
34 34
35 // Interrupt a thread. 35 // Interrupt a thread.
36 static void InterruptThread(Thread* thread); 36 static void InterruptThread(Thread* thread);
37 37
38 private: 38 private:
39 static const intptr_t kMaxThreads = 4096; 39 static const intptr_t kMaxThreads = 4096;
40 static bool initialized_; 40 static bool initialized_;
41 static bool shutdown_; 41 static bool shutdown_;
42 static bool thread_running_; 42 static bool thread_running_;
43 static ThreadId interrupter_thread_id_; 43 static ThreadJoinId interrupter_thread_id_;
44 static Monitor* monitor_; 44 static Monitor* monitor_;
45 static intptr_t interrupt_period_; 45 static intptr_t interrupt_period_;
46 static intptr_t current_wait_time_; 46 static intptr_t current_wait_time_;
47 47
48 static bool InDeepSleep() { 48 static bool InDeepSleep() {
49 return current_wait_time_ == Monitor::kNoTimeout; 49 return current_wait_time_ == Monitor::kNoTimeout;
50 } 50 }
51 51
52 static void UpdateStateObject(ThreadInterruptCallback callback, void* data); 52 static void UpdateStateObject(ThreadInterruptCallback callback, void* data);
53 53
54 static void ThreadMain(uword parameters); 54 static void ThreadMain(uword parameters);
55 55
56 static void InstallSignalHandler(); 56 static void InstallSignalHandler();
57 57
58 static void RemoveSignalHandler(); 58 static void RemoveSignalHandler();
59 59
60 friend class ThreadInterrupterVisitIsolates; 60 friend class ThreadInterrupterVisitIsolates;
61 }; 61 };
62 62
63 void ThreadInterruptNoOp(const InterruptedThreadState& state, void* data); 63 void ThreadInterruptNoOp(const InterruptedThreadState& state, void* data);
64 64
65 } // namespace dart 65 } // namespace dart
66 66
67 #endif // VM_THREAD_INTERRUPTER_H_ 67 #endif // VM_THREAD_INTERRUPTER_H_
OLDNEW
« no previous file with comments | « runtime/vm/service_isolate.cc ('k') | runtime/vm/thread_interrupter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698