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

Side by Side Diff: runtime/bin/vmstats_impl.h

Issue 12316148: Quick fix for racy shutdown issues in VmStats. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/vmstats_impl.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 BIN_VMSTATS_IMPL_H_ 5 #ifndef BIN_VMSTATS_IMPL_H_
6 #define BIN_VMSTATS_IMPL_H_ 6 #define BIN_VMSTATS_IMPL_H_
7 7
8 #include "bin/vmstats.h" 8 #include "bin/vmstats.h"
9 9
10 #include <map> 10 #include <map>
(...skipping 25 matching lines...) Expand all
36 char* IsolatesStatus(); 36 char* IsolatesStatus();
37 37
38 typedef std::map<IsolateData*, Dart_Isolate> IsolateTable; 38 typedef std::map<IsolateData*, Dart_Isolate> IsolateTable;
39 39
40 std::string root_directory_; 40 std::string root_directory_;
41 IsolateTable isolate_table_; 41 IsolateTable isolate_table_;
42 bool running_; 42 bool running_;
43 int64_t bind_address_; 43 int64_t bind_address_;
44 44
45 static VmStats* instance_; 45 static VmStats* instance_;
46 static dart::Monitor instance_monitor_; 46 static dart::Monitor* instance_monitor_;
47 47
48 // Disallow copy constructor. 48 // Disallow copy constructor.
49 DISALLOW_COPY_AND_ASSIGN(VmStats); 49 DISALLOW_COPY_AND_ASSIGN(VmStats);
50 }; 50 };
51 51
52 52
53 // Status plug-in and linked-list node. 53 // Status plug-in and linked-list node.
54 class VmStatusPlugin { 54 class VmStatusPlugin {
55 public: 55 public:
56 explicit VmStatusPlugin(Dart_VmStatusCallback callback) 56 explicit VmStatusPlugin(Dart_VmStatusCallback callback)
(...skipping 25 matching lines...) Expand all
82 // Returns VM status for a specified request. The caller is responsible 82 // Returns VM status for a specified request. The caller is responsible
83 // for releasing the heap memory after use. 83 // for releasing the heap memory after use.
84 static char* GetVmStatus(const char* request); 84 static char* GetVmStatus(const char* request);
85 85
86 static void InitOnce(); 86 static void InitOnce();
87 87
88 private: 88 private:
89 VmStatusService() : registered_plugin_list_(NULL) {} 89 VmStatusService() : registered_plugin_list_(NULL) {}
90 90
91 static VmStatusService* instance_; 91 static VmStatusService* instance_;
92 static dart::Mutex mutex_; 92 static dart::Mutex* mutex_;
93 93
94 VmStatusPlugin* registered_plugin_list_; 94 VmStatusPlugin* registered_plugin_list_;
95 95
96 DISALLOW_COPY_AND_ASSIGN(VmStatusService); 96 DISALLOW_COPY_AND_ASSIGN(VmStatusService);
97 }; 97 };
98 98
99 #endif // BIN_VMSTATS_IMPL_H_ 99 #endif // BIN_VMSTATS_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/vmstats_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698