OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project 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 // Platform-specific code for POSIX goes here. This is not a platform on its | 5 // Platform-specific code for POSIX goes here. This is not a platform on its |
6 // own, but contains the parts which are the same across the POSIX platforms | 6 // own, but contains the parts which are the same across the POSIX platforms |
7 // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX. | 7 // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX. |
8 | 8 |
9 #include <errno.h> | 9 #include <errno.h> |
10 #include <limits.h> | 10 #include <limits.h> |
11 #include <pthread.h> | 11 #include <pthread.h> |
12 #if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) | 12 #if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) |
13 #include <pthread_np.h> // for pthread_set_name_np | 13 #include <pthread_np.h> // for pthread_set_name_np |
14 #endif | 14 #endif |
15 #include <sched.h> // for sched_yield | 15 #include <sched.h> // for sched_yield |
| 16 #include <stdio.h> |
16 #include <time.h> | 17 #include <time.h> |
17 #include <unistd.h> | 18 #include <unistd.h> |
18 | 19 |
19 #include <sys/mman.h> | 20 #include <sys/mman.h> |
20 #include <sys/resource.h> | 21 #include <sys/resource.h> |
21 #include <sys/stat.h> | 22 #include <sys/stat.h> |
22 #include <sys/time.h> | 23 #include <sys/time.h> |
23 #include <sys/types.h> | 24 #include <sys/types.h> |
24 #if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || \ | 25 #if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || \ |
25 defined(__NetBSD__) || defined(__OpenBSD__) | 26 defined(__NetBSD__) || defined(__OpenBSD__) |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 | 670 |
670 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { | 671 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
671 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); | 672 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); |
672 int result = pthread_setspecific(pthread_key, value); | 673 int result = pthread_setspecific(pthread_key, value); |
673 DCHECK_EQ(0, result); | 674 DCHECK_EQ(0, result); |
674 USE(result); | 675 USE(result); |
675 } | 676 } |
676 | 677 |
677 | 678 |
678 } } // namespace v8::base | 679 } } // namespace v8::base |
OLD | NEW |