src/os/windows/vm/os_windows.cpp

changeset 9676
bf1c9a3312a4
parent 9628
04cb6ac03887
child 9703
2fdf635bcf28
child 9711
0f2fe7d37d8c
equal deleted inserted replaced
9675:894c78fcb2ea 9676:bf1c9a3312a4
742 return proc_count; 742 return proc_count;
743 } 743 }
744 } 744 }
745 745
746 void os::set_native_thread_name(const char *name) { 746 void os::set_native_thread_name(const char *name) {
747 // Not yet implemented. 747
748 return; 748 // See: http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx
749 //
750 // Note that unfortunately this only works if the process
751 // is already attached to a debugger; debugger must observe
752 // the exception below to show the correct name.
753
754 const DWORD MS_VC_EXCEPTION = 0x406D1388;
755 struct {
756 DWORD dwType; // must be 0x1000
757 LPCSTR szName; // pointer to name (in user addr space)
758 DWORD dwThreadID; // thread ID (-1=caller thread)
759 DWORD dwFlags; // reserved for future use, must be zero
760 } info;
761
762 info.dwType = 0x1000;
763 info.szName = name;
764 info.dwThreadID = -1;
765 info.dwFlags = 0;
766
767 __try {
768 RaiseException (MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (const ULONG_PTR*)&info );
769 } __except(EXCEPTION_CONTINUE_EXECUTION) {}
749 } 770 }
750 771
751 bool os::distribute_processes(uint length, uint* distribution) { 772 bool os::distribute_processes(uint length, uint* distribution) {
752 // Not yet implemented. 773 // Not yet implemented.
753 return false; 774 return false;

mercurial