OLD | NEW |
1 // Copyright (c) 2011, 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/isolate.h" |
| 6 |
5 #include <errno.h> | 7 #include <errno.h> |
6 #include <pthread.h> | 8 #include <pthread.h> |
7 | 9 |
8 #include "vm/assert.h" | 10 #include "platform/assert.h" |
9 #include "vm/isolate.h" | |
10 | 11 |
11 namespace dart { | 12 namespace dart { |
12 | 13 |
13 #define VALIDATE_PTHREAD_RESULT(result) \ | 14 #define VALIDATE_PTHREAD_RESULT(result) \ |
14 if (result != 0) { \ | 15 if (result != 0) { \ |
15 FATAL2("pthread error: %d (%s)", result, strerror(result)); \ | 16 FATAL2("pthread error: %d (%s)", result, strerror(result)); \ |
16 } | 17 } |
17 | 18 |
18 | 19 |
19 // The single pthread key which stores all the thread local data for a | 20 // The single pthread key which stores all the thread local data for a |
(...skipping 12 matching lines...) Expand all Loading... |
32 void Isolate::InitOnce() { | 33 void Isolate::InitOnce() { |
33 ASSERT(isolate_key == PTHREAD_KEY_UNSET); | 34 ASSERT(isolate_key == PTHREAD_KEY_UNSET); |
34 int result = pthread_key_create(&isolate_key, NULL); | 35 int result = pthread_key_create(&isolate_key, NULL); |
35 // Make sure creating a key was successful. | 36 // Make sure creating a key was successful. |
36 VALIDATE_PTHREAD_RESULT(result); | 37 VALIDATE_PTHREAD_RESULT(result); |
37 ASSERT(isolate_key != PTHREAD_KEY_UNSET); | 38 ASSERT(isolate_key != PTHREAD_KEY_UNSET); |
38 create_callback_ = NULL; | 39 create_callback_ = NULL; |
39 } | 40 } |
40 | 41 |
41 } // namespace dart | 42 } // namespace dart |
OLD | NEW |