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

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

Issue 2481873005: clang-format runtime/vm (Closed)
Patch Set: Merge Created 4 years, 1 month 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/thread_pool_test.cc ('k') | runtime/vm/thread_test.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 RUNTIME_VM_THREAD_REGISTRY_H_ 5 #ifndef RUNTIME_VM_THREAD_REGISTRY_H_
6 #define RUNTIME_VM_THREAD_REGISTRY_H_ 6 #define RUNTIME_VM_THREAD_REGISTRY_H_
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #include "vm/growable_array.h" 9 #include "vm/growable_array.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 25 matching lines...) Expand all
36 void ReturnThreadLocked(bool is_mutator, Thread* thread); 36 void ReturnThreadLocked(bool is_mutator, Thread* thread);
37 void AddToActiveListLocked(Thread* thread); 37 void AddToActiveListLocked(Thread* thread);
38 void RemoveFromActiveListLocked(Thread* thread); 38 void RemoveFromActiveListLocked(Thread* thread);
39 Thread* GetFromFreelistLocked(Isolate* isolate); 39 Thread* GetFromFreelistLocked(Isolate* isolate);
40 void ReturnToFreelistLocked(Thread* thread); 40 void ReturnToFreelistLocked(Thread* thread);
41 41
42 // This monitor protects the threads list for an isolate, it is used whenever 42 // This monitor protects the threads list for an isolate, it is used whenever
43 // we need to iterate over threads (both active and free) in an isolate. 43 // we need to iterate over threads (both active and free) in an isolate.
44 Monitor* threads_lock_; 44 Monitor* threads_lock_;
45 Thread* active_list_; // List of active threads in the isolate. 45 Thread* active_list_; // List of active threads in the isolate.
46 Thread* free_list_; // Free list of Thread objects that can be reused. 46 Thread* free_list_; // Free list of Thread objects that can be reused.
47 47
48 // TODO(asiva): Currently we treat a mutator thread as a special thread 48 // TODO(asiva): Currently we treat a mutator thread as a special thread
49 // and always schedule execution of Dart code on the same mutator thread 49 // and always schedule execution of Dart code on the same mutator thread
50 // object. The ApiLocalScope has been made thread specific but we still 50 // object. The ApiLocalScope has been made thread specific but we still
51 // have scenarios where we do a temporary exit of an Isolate with live 51 // have scenarios where we do a temporary exit of an Isolate with live
52 // zones/handles in the API scope : 52 // zones/handles in the API scope :
53 // - Dart_RunLoop() 53 // - Dart_RunLoop()
54 // - IsolateSaver in Dart_NewNativePort 54 // - IsolateSaver in Dart_NewNativePort
55 // - Isolate spawn (function/uri) under FLAG_i_like_slow_isolate_spawn 55 // - Isolate spawn (function/uri) under FLAG_i_like_slow_isolate_spawn
56 // We probably need a mechanism to return to the specific thread only 56 // We probably need a mechanism to return to the specific thread only
57 // for these specific cases. We should also determine if the embedder 57 // for these specific cases. We should also determine if the embedder
58 // should allow exiting an isolate with live state in zones/handles in 58 // should allow exiting an isolate with live state in zones/handles in
59 // which case a new API for returning to the specific thread needs to be 59 // which case a new API for returning to the specific thread needs to be
60 // added. 60 // added.
61 Thread* mutator_thread_; 61 Thread* mutator_thread_;
62 62
63 friend class Isolate; 63 friend class Isolate;
64 friend class SafepointHandler; 64 friend class SafepointHandler;
65 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry); 65 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry);
66 }; 66 };
67 67
68 } // namespace dart 68 } // namespace dart
69 69
70 #endif // RUNTIME_VM_THREAD_REGISTRY_H_ 70 #endif // RUNTIME_VM_THREAD_REGISTRY_H_
OLDNEW
« no previous file with comments | « runtime/vm/thread_pool_test.cc ('k') | runtime/vm/thread_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698