Changeset 101041 in webkit for trunk/Source/JavaScriptCore/wtf/ThreadingPthreads.cpp
- Timestamp:
- Nov 22, 2011, 7:30:34 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/wtf/ThreadingPthreads.cpp
r95511 r101041 2 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2007 Justin Haygood ([email protected]) 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 4 5 * 5 6 * Redistribution and use in source and binary forms, with or without … … 56 57 #endif 57 58 59 #if PLATFORM(BLACKBERRY) 60 #include <BlackBerryPlatformMisc.h> 61 #include <BlackBerryPlatformSettings.h> 62 #endif 63 58 64 namespace WTF { 59 65 … … 147 153 } 148 154 155 #if PLATFORM(BLACKBERRY) 156 ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char* threadName) 157 { 158 pthread_attr_t attr; 159 if (pthread_attr_init(&attr)) { 160 LOG_ERROR("pthread_attr_init() failed: %d", errno); 161 return 0; 162 } 163 164 void* stackAddr; 165 size_t stackSize; 166 if (pthread_attr_getstack(&attr, &stackAddr, &stackSize)) 167 LOG_ERROR("pthread_attr_getstack() failed: %d", errno); 168 else { 169 stackSize = BlackBerry::Platform::Settings::get()->secondaryThreadStackSize(); 170 if (pthread_attr_setstack(&attr, stackAddr, stackSize)) 171 LOG_ERROR("pthread_attr_getstack() failed: %d", errno); 172 } 173 174 pthread_t threadHandle; 175 if (pthread_create(&threadHandle, &attr, entryPoint, data)) { 176 LOG_ERROR("pthread_create() failed: %d", errno); 177 threadHandle = 0; 178 } 179 pthread_setname_np(threadHandle, threadName); 180 181 pthread_attr_destroy(&attr); 182 183 if (!threadHandle) 184 return 0; 185 186 return establishIdentifierForPthreadHandle(threadHandle); 187 } 188 #else 149 189 ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char*) 150 190 { … … 157 197 return establishIdentifierForPthreadHandle(threadHandle); 158 198 } 199 #endif 159 200 160 201 void initializeCurrentThreadInternal(const char* threadName)
Note:
See TracChangeset
for help on using the changeset viewer.