| 314 | } |
| 315 | |
| 316 | void ThreadImpl::setName(const char* name) |
| 317 | { |
| 318 | getThread(this)->name = name; |
| 319 | |
| 320 | if (getThread(this)->state == _ThreadImpl::Started) |
| 321 | { |
| 322 | THREADNAME_INFO info; |
| 323 | info.dwType = 0x1000; |
| 324 | info.szName = name; |
| 325 | info.dwThreadID = getThread(this)->threadID; |
| 326 | info.dwFlags = 0; |
| 327 | |
| 328 | // C++ Exceptions are disabled for this project, but SEH is not (and cannot be) |
| 329 | // http://stackoverflow.com/questions/943087/what-exactly-will-happen-if-i-disable-c-exceptions-in-a-project |
| 330 | __try |
| 331 | { |
| 332 | RaiseException(NS_MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info); |
| 333 | } |
| 334 | __except (EXCEPTION_EXECUTE_HANDLER) |
| 335 | { |
| 336 | // this runs if not attached to a debugger (thus not really naming the thread) |
| 337 | } |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | void ThreadImpl::setPriority(ThreadPriority::Enum prio) |
| 342 | { |
nothing calls this directly
no test coverage detected