OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_PORT_H_ | 5 #ifndef VM_PORT_H_ |
6 #define VM_PORT_H_ | 6 #define VM_PORT_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 // Enqueues the message in the port with id. Returns false if the port is not | 37 // Enqueues the message in the port with id. Returns false if the port is not |
38 // active any longer. | 38 // active any longer. |
39 // | 39 // |
40 // Claims ownership of 'message'. | 40 // Claims ownership of 'message'. |
41 static bool PostMessage(Message* message); | 41 static bool PostMessage(Message* message); |
42 | 42 |
43 // Returns whether a port is local to the current isolate. | 43 // Returns whether a port is local to the current isolate. |
44 static bool IsLocalPort(Dart_Port id); | 44 static bool IsLocalPort(Dart_Port id); |
45 | 45 |
| 46 // Returns the owning Isolate for port 'id'. |
| 47 static Isolate* GetIsolate(Dart_Port id); |
| 48 |
46 static void InitOnce(); | 49 static void InitOnce(); |
47 | 50 |
48 private: | 51 private: |
49 friend class dart::PortMapTestPeer; | 52 friend class dart::PortMapTestPeer; |
50 | 53 |
51 // Mapping between port numbers and handlers. | 54 // Mapping between port numbers and handlers. |
52 // | 55 // |
53 // Free entries have id == 0 and handler == NULL. Deleted entries | 56 // Free entries have id == 0 and handler == NULL. Deleted entries |
54 // have id == 0 and handler == deleted_entry_. | 57 // have id == 0 and handler == deleted_entry_. |
55 typedef struct { | 58 typedef struct { |
(...skipping 22 matching lines...) Expand all Loading... |
78 static intptr_t capacity_; | 81 static intptr_t capacity_; |
79 static intptr_t used_; | 82 static intptr_t used_; |
80 static intptr_t deleted_; | 83 static intptr_t deleted_; |
81 | 84 |
82 static Dart_Port next_port_; | 85 static Dart_Port next_port_; |
83 }; | 86 }; |
84 | 87 |
85 } // namespace dart | 88 } // namespace dart |
86 | 89 |
87 #endif // VM_PORT_H_ | 90 #endif // VM_PORT_H_ |
OLD | NEW |