| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) | 3 * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) |
| 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. | 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "wtf/dtoa.h" | 48 #include "wtf/dtoa.h" |
| 49 #include "wtf/dtoa/cached-powers.h" | 49 #include "wtf/dtoa/cached-powers.h" |
| 50 #include <errno.h> | 50 #include <errno.h> |
| 51 | 51 |
| 52 #if !COMPILER(MSVC) | 52 #if !COMPILER(MSVC) |
| 53 #include <limits.h> | 53 #include <limits.h> |
| 54 #include <sched.h> | 54 #include <sched.h> |
| 55 #include <sys/time.h> | 55 #include <sys/time.h> |
| 56 #endif | 56 #endif |
| 57 | 57 |
| 58 #if OS(DARWIN) | 58 #if OS(MACOSX) |
| 59 #include <objc/objc-auto.h> | 59 #include <objc/objc-auto.h> |
| 60 #endif | 60 #endif |
| 61 | 61 |
| 62 namespace WTF { | 62 namespace WTF { |
| 63 | 63 |
| 64 class PthreadState { | 64 class PthreadState { |
| 65 WTF_MAKE_FAST_ALLOCATED; | 65 WTF_MAKE_FAST_ALLOCATED; |
| 66 public: | 66 public: |
| 67 enum JoinableState { | 67 enum JoinableState { |
| 68 Joinable, // The default thread state. The thread can be joined on. | 68 Joinable, // The default thread state. The thread can be joined on. |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 } | 197 } |
| 198 | 198 |
| 199 void initializeCurrentThreadInternal(const char* threadName) | 199 void initializeCurrentThreadInternal(const char* threadName) |
| 200 { | 200 { |
| 201 #if HAVE(PTHREAD_SETNAME_NP) | 201 #if HAVE(PTHREAD_SETNAME_NP) |
| 202 pthread_setname_np(threadName); | 202 pthread_setname_np(threadName); |
| 203 #else | 203 #else |
| 204 UNUSED_PARAM(threadName); | 204 UNUSED_PARAM(threadName); |
| 205 #endif | 205 #endif |
| 206 | 206 |
| 207 #if OS(DARWIN) | 207 #if OS(MACOSX) |
| 208 // All threads that potentially use APIs above the BSD layer must be registe
red with the Objective-C | 208 // All threads that potentially use APIs above the BSD layer must be registe
red with the Objective-C |
| 209 // garbage collector in case API implementations use garbage-collected memor
y. | 209 // garbage collector in case API implementations use garbage-collected memor
y. |
| 210 objc_registerThreadWithCollector(); | 210 objc_registerThreadWithCollector(); |
| 211 #endif | 211 #endif |
| 212 | 212 |
| 213 ThreadIdentifier id = identifierByPthreadHandle(pthread_self()); | 213 ThreadIdentifier id = identifierByPthreadHandle(pthread_self()); |
| 214 ASSERT(id); | 214 ASSERT(id); |
| 215 ThreadIdentifierData::initialize(id); | 215 ThreadIdentifierData::initialize(id); |
| 216 } | 216 } |
| 217 | 217 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 | 385 |
| 386 void ThreadCondition::broadcast() | 386 void ThreadCondition::broadcast() |
| 387 { | 387 { |
| 388 int result = pthread_cond_broadcast(&m_condition); | 388 int result = pthread_cond_broadcast(&m_condition); |
| 389 ASSERT_UNUSED(result, !result); | 389 ASSERT_UNUSED(result, !result); |
| 390 } | 390 } |
| 391 | 391 |
| 392 } // namespace WTF | 392 } // namespace WTF |
| 393 | 393 |
| 394 #endif // USE(PTHREADS) | 394 #endif // USE(PTHREADS) |
| OLD | NEW |