OLD | NEW |
1 // Copyright 2009 The RE2 Authors. All Rights Reserved. | 1 // Copyright 2009 The RE2 Authors. All Rights Reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
| 5 #include <pthread.h> |
| 6 |
| 7 #include "util/util.h" |
5 #include "util/thread.h" | 8 #include "util/thread.h" |
6 #include "util/util.h" | |
7 | 9 |
8 Thread::Thread() { | 10 Thread::Thread() { |
9 pid_ = 0; | 11 pid_ = 0; |
10 running_ = 0; | 12 running_ = 0; |
11 joinable_ = 0; | 13 joinable_ = 0; |
12 } | 14 } |
13 | 15 |
14 Thread::~Thread() { | 16 Thread::~Thread() { |
15 } | 17 } |
16 | 18 |
(...skipping 16 matching lines...) Expand all Loading... |
33 CHECK(joinable_); | 35 CHECK(joinable_); |
34 void *val; | 36 void *val; |
35 pthread_join(pid_, &val); | 37 pthread_join(pid_, &val); |
36 running_ = 0; | 38 running_ = 0; |
37 } | 39 } |
38 | 40 |
39 void Thread::SetJoinable(bool j) { | 41 void Thread::SetJoinable(bool j) { |
40 CHECK(!running_); | 42 CHECK(!running_); |
41 joinable_ = j; | 43 joinable_ = j; |
42 } | 44 } |
OLD | NEW |