OLD | NEW |
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 "platform/assert.h" | 5 #include "platform/assert.h" |
6 #include "vm/message.h" | 6 #include "vm/message.h" |
7 #include "vm/os.h" | 7 #include "vm/os.h" |
8 #include "vm/port.h" | 8 #include "vm/port.h" |
9 #include "vm/unit_test.h" | 9 #include "vm/unit_test.h" |
10 | 10 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 147 } |
148 | 148 |
149 | 149 |
150 intptr_t GetIntData(uint8_t* data) { | 150 intptr_t GetIntData(uint8_t* data) { |
151 return *reinterpret_cast<intptr_t*>(data); | 151 return *reinterpret_cast<intptr_t*>(data); |
152 } | 152 } |
153 | 153 |
154 | 154 |
155 static Message* NextMessage() { | 155 static Message* NextMessage() { |
156 Isolate* isolate = Isolate::Current(); | 156 Isolate* isolate = Isolate::Current(); |
157 Message* result = isolate->message_handler()->Dequeue(0); | 157 Message* result = isolate->message_handler()->queue()->Dequeue(0); |
158 return result; | 158 return result; |
159 } | 159 } |
160 | 160 |
161 | 161 |
162 void ThreadedPort_start(uword parameter) { | 162 void ThreadedPort_start(uword parameter) { |
163 // TODO(turnidge): We only use the isolate to get access to its | 163 // TODO(turnidge): We only use the isolate to get access to its |
164 // message handler. I should rewrite this test to use a | 164 // message handler. I should rewrite this test to use a |
165 // TestMessageHandler instead. | 165 // TestMessageHandler instead. |
166 Isolate* isolate = Dart::CreateIsolate(NULL); | 166 Isolate* isolate = Dart::CreateIsolate(NULL); |
167 | 167 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 // Give the spawned thread enough time to properly exit. | 223 // Give the spawned thread enough time to properly exit. |
224 Monitor* waiter = new Monitor(); | 224 Monitor* waiter = new Monitor(); |
225 { | 225 { |
226 MonitorLocker ml(waiter); | 226 MonitorLocker ml(waiter); |
227 ml.Wait(20); | 227 ml.Wait(20); |
228 } | 228 } |
229 delete waiter; | 229 delete waiter; |
230 } | 230 } |
231 | 231 |
232 } // namespace dart | 232 } // namespace dart |
OLD | NEW |