| OLD | NEW |
| 1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 #ifndef SRC_VM_THREAD_H_ | 5 #ifndef SRC_VM_THREAD_H_ |
| 6 #define SRC_VM_THREAD_H_ | 6 #define SRC_VM_THREAD_H_ |
| 7 | 7 |
| 8 #include "src/shared/globals.h" | 8 #include "src/shared/globals.h" |
| 9 #include "src/shared/platform.h" | 9 #include "src/shared/platform.h" |
| 10 | 10 |
| 11 #if defined(FLETCH_TARGET_OS_POSIX) | 11 #if defined(DARTINO_TARGET_OS_POSIX) |
| 12 #include "src/vm/thread_posix.h" | 12 #include "src/vm/thread_posix.h" |
| 13 #elif defined(FLETCH_TARGET_OS_LK) | 13 #elif defined(DARTINO_TARGET_OS_LK) |
| 14 #include "src/vm/thread_lk.h" | 14 #include "src/vm/thread_lk.h" |
| 15 #elif defined(FLETCH_TARGET_OS_CMSIS) | 15 #elif defined(DARTINO_TARGET_OS_CMSIS) |
| 16 #include "src/vm/thread_cmsis.h" | 16 #include "src/vm/thread_cmsis.h" |
| 17 #elif defined(FLETCH_TARGET_OS_WIN) | 17 #elif defined(DARTINO_TARGET_OS_WIN) |
| 18 #include "src/vm/thread_windows.h" | 18 #include "src/vm/thread_windows.h" |
| 19 #else | 19 #else |
| 20 #error "OS is lacking thread implementation." | 20 #error "OS is lacking thread implementation." |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 namespace fletch { | 23 namespace dartino { |
| 24 | 24 |
| 25 // A ThreadIdentifier represents a thread identifier for a thread. | 25 // A ThreadIdentifier represents a thread identifier for a thread. |
| 26 // The ThreadIdentifier does not own the underlying OS handle. | 26 // The ThreadIdentifier does not own the underlying OS handle. |
| 27 // Thread handles can be used for referring to threads and testing equality. | 27 // Thread handles can be used for referring to threads and testing equality. |
| 28 class ThreadIdentifier; | 28 class ThreadIdentifier; |
| 29 | 29 |
| 30 // Forward declaration. | 30 // Forward declaration. |
| 31 class Process; | 31 class Process; |
| 32 | 32 |
| 33 // Thread are started using the static Thread::Run method. | 33 // Thread are started using the static Thread::Run method. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 46 static void SetProcess(Process* process); | 46 static void SetProcess(Process* process); |
| 47 static Process* GetProcess(); | 47 static Process* GetProcess(); |
| 48 | 48 |
| 49 typedef void* (*RunSignature)(void*); | 49 typedef void* (*RunSignature)(void*); |
| 50 static ThreadIdentifier Run(RunSignature run, void* data = NULL); | 50 static ThreadIdentifier Run(RunSignature run, void* data = NULL); |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 DISALLOW_ALLOCATION(); | 53 DISALLOW_ALLOCATION(); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // namespace fletch | 56 } // namespace dartino |
| 57 | 57 |
| 58 #endif // SRC_VM_THREAD_H_ | 58 #endif // SRC_VM_THREAD_H_ |
| OLD | NEW |