Changeset 230474 in webkit
- Timestamp:
- Apr 10, 2018 12:58:19 AM (6 years ago)
- Location:
- trunk/Source/bmalloc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/bmalloc/ChangeLog
r230463 r230474 1 2018-04-09 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 [bmalloc] Name Scavenger thread "bmalloc scavenger" 4 https://bugs.webkit.org/show_bug.cgi?id=166684 5 6 Reviewed by Saam Barati. 7 8 We name the thread for bmalloc Scavenger "bmalloc scavenger". 9 It is useful for debugging. In Linux environment, it will be 10 shown in GDB. 11 12 * bmalloc/Scavenger.cpp: 13 (bmalloc::Scavenger::threadRunLoop): 14 (bmalloc::Scavenger::setName): 15 * bmalloc/Scavenger.h: 16 1 17 2018-04-09 Michael Catanzaro <mcatanzaro@igalia.com> 2 18 -
trunk/Source/bmalloc/bmalloc/Scavenger.cpp
r230308 r230474 227 227 { 228 228 setSelfQOSClass(); 229 setThreadName("bmalloc scavenger"); 229 230 230 231 // This loop ratchets downward from most active to least active state. While … … 271 272 } 272 273 274 void Scavenger::setThreadName(const char* name) 275 { 276 BUNUSED(name); 277 #if BOS(DARWIN) 278 pthread_setname_np(name); 279 #elif BOS(LINUX) 280 // Truncate the given name since Linux limits the size of the thread name 16 including null terminator. 281 std::array<char, 16> buf; 282 strncpy(buf.data(), name, buf.size() - 1); 283 buf[buf.size() - 1] = '\0'; 284 pthread_setname_np(pthread_self(), buf.data()); 285 #endif 286 } 287 273 288 void Scavenger::setSelfQOSClass() 274 289 { -
trunk/Source/bmalloc/bmalloc/Scavenger.h
r230308 r230474 84 84 85 85 void setSelfQOSClass(); 86 void setThreadName(const char*); 86 87 87 88 std::atomic<State> m_state { State::Sleep };
Note: See TracChangeset
for help on using the changeset viewer.