| 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 <dlfcn.h> | 9 #include <dlfcn.h> |
| 10 #include <pthread.h> | 10 #include <pthread.h> |
| 11 #if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) | 11 #if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) |
| 12 #include <pthread_np.h> // for pthread_set_name_np | 12 #include <pthread_np.h> // for pthread_set_name_np |
| 13 #endif | 13 #endif |
| 14 #include <sched.h> // for sched_yield | 14 #include <sched.h> // for sched_yield |
| 15 #include <unistd.h> | 15 #include <unistd.h> |
| 16 #include <errno.h> | 16 #include <errno.h> |
| 17 #include <time.h> | 17 #include <time.h> |
| 18 | 18 |
| 19 #include <sys/mman.h> | 19 #include <sys/mman.h> |
| 20 #include <sys/socket.h> | |
| 21 #include <sys/resource.h> | 20 #include <sys/resource.h> |
| 22 #include <sys/time.h> | 21 #include <sys/time.h> |
| 23 #include <sys/types.h> | 22 #include <sys/types.h> |
| 24 #include <sys/stat.h> | 23 #include <sys/stat.h> |
| 25 #if defined(__linux__) | 24 #if defined(__linux__) |
| 26 #include <sys/prctl.h> // for prctl | 25 #include <sys/prctl.h> // for prctl |
| 27 #endif | 26 #endif |
| 28 #if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || \ | 27 #if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || \ |
| 29 defined(__NetBSD__) || defined(__OpenBSD__) | 28 defined(__NetBSD__) || defined(__OpenBSD__) |
| 30 #include <sys/sysctl.h> // for sysctl | 29 #include <sys/sysctl.h> // for sysctl |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 | 751 |
| 753 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { | 752 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
| 754 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); | 753 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); |
| 755 int result = pthread_setspecific(pthread_key, value); | 754 int result = pthread_setspecific(pthread_key, value); |
| 756 ASSERT_EQ(0, result); | 755 ASSERT_EQ(0, result); |
| 757 USE(result); | 756 USE(result); |
| 758 } | 757 } |
| 759 | 758 |
| 760 | 759 |
| 761 } } // namespace v8::internal | 760 } } // namespace v8::internal |
| OLD | NEW |