OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/platform_thread.h" | 5 #include "base/platform_thread.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <sched.h> | 8 #include <sched.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 bool PlatformThread::CreateNonJoinable(size_t stack_size, Delegate* delegate) { | 212 bool PlatformThread::CreateNonJoinable(size_t stack_size, Delegate* delegate) { |
213 PlatformThreadHandle unused; | 213 PlatformThreadHandle unused; |
214 | 214 |
215 bool result = CreateThread(stack_size, false /* non-joinable thread */, | 215 bool result = CreateThread(stack_size, false /* non-joinable thread */, |
216 delegate, &unused); | 216 delegate, &unused); |
217 return result; | 217 return result; |
218 } | 218 } |
219 | 219 |
220 // static | 220 // static |
221 void PlatformThread::Join(PlatformThreadHandle thread_handle) { | 221 void PlatformThread::Join(PlatformThreadHandle thread_handle) { |
| 222 // Joining another thread may block the current thread for a long time, since |
| 223 // the thread referred to by |thread_handle| may still be running long-lived / |
| 224 // blocking tasks. |
| 225 base::ThreadRestrictions::AssertIOAllowed(); |
222 pthread_join(thread_handle, NULL); | 226 pthread_join(thread_handle, NULL); |
223 } | 227 } |
OLD | NEW |