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

Side by Side Diff: src/vm/thread_posix.h

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 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 | « src/vm/thread_pool.cc ('k') | src/vm/thread_posix.cc » ('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) 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_POSIX_H_ 5 #ifndef SRC_VM_THREAD_POSIX_H_
6 #define SRC_VM_THREAD_POSIX_H_ 6 #define SRC_VM_THREAD_POSIX_H_
7 7
8 #ifndef SRC_VM_THREAD_H_ 8 #ifndef SRC_VM_THREAD_H_
9 #error "Don't include thread_posix.h directly, include thread.h." 9 #error "Don't include thread_posix.h directly, include thread.h."
10 #endif 10 #endif
11 11
12 #include <pthread.h> 12 #include <pthread.h>
13 #include <signal.h> 13 #include <signal.h>
14 #include <errno.h> 14 #include <errno.h>
15 15
16 #include "src/shared/assert.h" 16 #include "src/shared/assert.h"
17 17
18 namespace fletch { 18 namespace dartino {
19 19
20 // A ThreadIdentifier represents a thread identifier for a thread. 20 // A ThreadIdentifier represents a thread identifier for a thread.
21 // The ThreadIdentifier does not own the underlying OS handle. 21 // The ThreadIdentifier does not own the underlying OS handle.
22 // Thread handles can be used for referring to threads and testing equality. 22 // Thread handles can be used for referring to threads and testing equality.
23 class ThreadIdentifier { 23 class ThreadIdentifier {
24 public: 24 public:
25 ThreadIdentifier() : thread_(pthread_self()) {} 25 ThreadIdentifier() : thread_(pthread_self()) {}
26 26
27 // Test for thread running. 27 // Test for thread running.
28 bool IsSelf() const { return pthread_equal(thread_, pthread_self()); } 28 bool IsSelf() const { return pthread_equal(thread_, pthread_self()); }
(...skipping 12 matching lines...) Expand all
41 } 41 }
42 42
43 private: 43 private:
44 friend class Thread; 44 friend class Thread;
45 45
46 explicit ThreadIdentifier(pthread_t thread) : thread_(thread) {} 46 explicit ThreadIdentifier(pthread_t thread) : thread_(thread) {}
47 47
48 pthread_t thread_; 48 pthread_t thread_;
49 }; 49 };
50 50
51 } // namespace fletch 51 } // namespace dartino
52 52
53 #endif // SRC_VM_THREAD_POSIX_H_ 53 #endif // SRC_VM_THREAD_POSIX_H_
OLDNEW
« no previous file with comments | « src/vm/thread_pool.cc ('k') | src/vm/thread_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698