OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 | 32 |
33 #if USE(PTHREADS) | 33 #if USE(PTHREADS) |
34 | 34 |
35 #include "wtf/ThreadIdentifierDataPthreads.h" | 35 #include "wtf/ThreadIdentifierDataPthreads.h" |
36 | 36 |
37 #include "wtf/Assertions.h" | 37 #include "wtf/Assertions.h" |
38 #include "wtf/Threading.h" | 38 #include "wtf/Threading.h" |
39 | 39 |
40 #if OS(ANDROID) || OS(HURD) | 40 #if OS(ANDROID) |
41 // PTHREAD_KEYS_MAX is not defined in bionic nor in Hurd, so explicitly define i
t here. | 41 // PTHREAD_KEYS_MAX is not defined in bionic, so explicitly define it here. |
42 #define PTHREAD_KEYS_MAX 1024 | 42 #define PTHREAD_KEYS_MAX 1024 |
43 #else | 43 #else |
44 #include <limits.h> | 44 #include <limits.h> |
45 #endif | 45 #endif |
46 | 46 |
47 namespace WTF { | 47 namespace WTF { |
48 | 48 |
49 pthread_key_t ThreadIdentifierData::m_key = PTHREAD_KEYS_MAX; | 49 pthread_key_t ThreadIdentifierData::m_key = PTHREAD_KEYS_MAX; |
50 | 50 |
51 void threadDidExit(ThreadIdentifier); | 51 void threadDidExit(ThreadIdentifier); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } | 86 } |
87 | 87 |
88 threadIdentifierData->m_isDestroyedOnce = true; | 88 threadIdentifierData->m_isDestroyedOnce = true; |
89 // Re-setting the value for key causes another destruct() call after all oth
er thread-specific destructors were called. | 89 // Re-setting the value for key causes another destruct() call after all oth
er thread-specific destructors were called. |
90 pthread_setspecific(m_key, threadIdentifierData); | 90 pthread_setspecific(m_key, threadIdentifierData); |
91 } | 91 } |
92 | 92 |
93 } // namespace WTF | 93 } // namespace WTF |
94 | 94 |
95 #endif // USE(PTHREADS) | 95 #endif // USE(PTHREADS) |
OLD | NEW |