Changeset 166184 in webkit
- Timestamp:
- Mar 24, 2014, 12:25:32 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r166178 r166184 1 2014-03-24 Gavin Barraclough <[email protected]> 2 3 Add support for thread QoS 4 https://bugs.webkit.org/show_bug.cgi?id=130688 5 6 Reviewed by Andreas Kling. 7 8 * heap/BlockAllocator.cpp: 9 (JSC::BlockAllocator::blockFreeingThreadStartFunc): 10 - block freeing is a utility activity. 11 1 12 2014-03-24 Filip Pizlo <[email protected]> 2 13 -
trunk/Source/JavaScriptCore/heap/BlockAllocator.cpp
r163844 r166184 33 33 #include "WeakBlock.h" 34 34 #include <wtf/CurrentTime.h> 35 #include <wtf/Threading.h> 35 36 36 37 namespace JSC { … … 118 119 void BlockAllocator::blockFreeingThreadStartFunc(void* blockAllocator) 119 120 { 121 setCurrentThreadQOSUtility(); 120 122 static_cast<BlockAllocator*>(blockAllocator)->blockFreeingThreadMain(); 121 123 } -
trunk/Source/WTF/ChangeLog
r166149 r166184 1 2014-03-24 Gavin Barraclough <[email protected]> 2 3 Add support for thread QoS 4 https://bugs.webkit.org/show_bug.cgi?id=130688 5 6 Reviewed by Andreas Kling. 7 8 * wtf/FastMalloc.cpp: 9 (WTF::TCMalloc_PageHeap::runScavengerThread): 10 - block freeing is a utility activity. 11 * wtf/Threading.h: 12 - declaration. 13 * wtf/ThreadingPthreads.cpp: 14 (WTF::createThreadInternal): 15 - default to interactive. 16 (WTF::setCurrentThreadQOSUtility): 17 - implementation. 18 * wtf/ThreadingWin.cpp: 19 (WTF::setCurrentThreadQOSUtility): 20 - no-op implementation. 21 1 22 2014-03-23 Hyowon Kim <[email protected]> 2 23 -
trunk/Source/WTF/wtf/FastMalloc.cpp
r165729 r166184 80 80 #include "Assertions.h" 81 81 #include "CurrentTime.h" 82 #include "Threading.h" 82 83 83 84 #include <limits> … … 2059 2060 void* TCMalloc_PageHeap::runScavengerThread(void* context) 2060 2061 { 2062 setCurrentThreadQOSUtility(); 2063 2061 2064 static_cast<TCMalloc_PageHeap*>(context)->scavengerThread(); 2062 2065 #if (COMPILER(MSVC) || COMPILER(SUNCC)) -
trunk/Source/WTF/wtf/Threading.h
r165687 r166184 90 90 91 91 WTF_EXPORT_PRIVATE ThreadIdentifier currentThread(); 92 WTF_EXPORT_PRIVATE void setCurrentThreadQOSUtility(); 92 93 WTF_EXPORT_PRIVATE void changeThreadPriority(ThreadIdentifier, int); 93 94 WTF_EXPORT_PRIVATE int waitForThreadCompletion(ThreadIdentifier); … … 100 101 using WTF::currentThread; 101 102 using WTF::changeThreadPriority; 103 using WTF::setCurrentThreadQOSUtility; 102 104 using WTF::detachThread; 103 105 using WTF::waitForThreadCompletion; -
trunk/Source/WTF/wtf/ThreadingPthreads.cpp
r165691 r166184 174 174 auto invocation = std::make_unique<ThreadFunctionInvocation>(entryPoint, data); 175 175 pthread_t threadHandle; 176 if (pthread_create(&threadHandle, 0, wtfThreadEntryPoint, invocation.get())) { 176 pthread_attr_t attr; 177 pthread_attr_init(&attr); 178 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 179 pthread_attr_set_qos_class_np(&attr, QOS_CLASS_USER_INTERACTIVE, 0); 180 #endif 181 int error = pthread_create(&threadHandle, &attr, wtfThreadEntryPoint, invocation.get()); 182 pthread_attr_destroy(&attr); 183 184 if (error) { 177 185 LOG_ERROR("Failed to create pthread at entry point %p with data %p", wtfThreadEntryPoint, invocation.get()); 178 186 return 0; … … 226 234 pthread_setschedparam(pthreadHandle, policy, ¶m); 227 235 } 228 236 237 void setCurrentThreadQOSUtility() 238 { 239 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 240 pthread_set_qos_class_np(pthread_self(), QOS_CLASS_UTILITY, 0); 241 #endif 242 } 243 229 244 int waitForThreadCompletion(ThreadIdentifier threadID) 230 245 { -
trunk/Source/WTF/wtf/ThreadingWin.cpp
r165687 r166184 256 256 257 257 SetThreadPriority(threadHandle, THREAD_PRIORITY_NORMAL + delta); 258 } 259 260 void setCurrentThreadQOSUtility() 261 { 258 262 } 259 263
Note:
See TracChangeset
for help on using the changeset viewer.