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

Side by Side Diff: runtime/vm/port.cc

Issue 1748953003: - Add assertions in MutexLocker/MonitorLocker to ensure that the code enclosed (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-comments Created 4 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
« no previous file with comments | « runtime/vm/os_thread_win.cc ('k') | runtime/vm/profiler.h » ('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) 2012, the Dart project authors. Please see the AUTHORS 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 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 #include "vm/port.h" 5 #include "vm/port.h"
6 6
7 #include "vm/dart_entry.h" 7 #include "vm/dart_entry.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 void PortMap::PrintPortsForMessageHandler(MessageHandler* handler, 306 void PortMap::PrintPortsForMessageHandler(MessageHandler* handler,
307 JSONStream* stream) { 307 JSONStream* stream) {
308 if (!FLAG_support_service) { 308 if (!FLAG_support_service) {
309 return; 309 return;
310 } 310 }
311 JSONObject jsobj(stream); 311 JSONObject jsobj(stream);
312 jsobj.AddProperty("type", "_Ports"); 312 jsobj.AddProperty("type", "_Ports");
313 Object& msg_handler = Object::Handle(); 313 Object& msg_handler = Object::Handle();
314 { 314 {
315 JSONArray ports(&jsobj, "ports"); 315 JSONArray ports(&jsobj, "ports");
316 MutexLocker ml(mutex_); 316 SafepointMutexLocker ml(mutex_);
317 for (intptr_t i = 0; i < capacity_; i++) { 317 for (intptr_t i = 0; i < capacity_; i++) {
318 if (map_[i].handler == handler) { 318 if (map_[i].handler == handler) {
319 if (map_[i].state == kLivePort) { 319 if (map_[i].state == kLivePort) {
320 JSONObject port(&ports); 320 JSONObject port(&ports);
321 port.AddProperty("type", "_Port"); 321 port.AddProperty("type", "_Port");
322 port.AddPropertyF("name", "Isolate Port (%" Pd64 ")", map_[i].port); 322 port.AddPropertyF("name", "Isolate Port (%" Pd64 ")", map_[i].port);
323 msg_handler = DartLibraryCalls::LookupHandler(map_[i].port); 323 msg_handler = DartLibraryCalls::LookupHandler(map_[i].port);
324 port.AddProperty("handler", msg_handler); 324 port.AddProperty("handler", msg_handler);
325 } 325 }
326 } 326 }
327 } 327 }
328 } 328 }
329 } 329 }
330 330
331 } // namespace dart 331 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/os_thread_win.cc ('k') | runtime/vm/profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698