Changeset 71150 in vbox
- Timestamp:
- Feb 28, 2018 10:44:38 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
include/iprt/thread.h (modified) (2 diffs)
-
src/VBox/Runtime/r3/win/init-win.cpp (modified) (2 diffs)
-
src/VBox/Runtime/r3/win/internal-r3-win.h (modified) (1 diff)
-
src/VBox/Runtime/r3/win/thread-win.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/thread.h
r71127 r71150 483 483 * Pokes the thread. 484 484 * 485 * This will signal the thread, attempting to interrupt whatever it's currently 486 * doing. This is *NOT* implemented on all platforms and may cause unresolved 487 * symbols during linking or VERR_NOT_IMPLEMENTED at runtime. 485 * This will wake up or/and signal the thread, attempting to interrupt whatever 486 * it's currently doing. 487 * 488 * The posixy version of this will send a signal to the thread, quite likely 489 * waking it up from normal sleeps, waits, and I/O. When IPRT is in 490 * non-obtrusive mode, the posixy version will definitely return 491 * VERR_NOT_IMPLEMENTED, and it may also do so if no usable signal was found. 492 * 493 * On Windows the thread will be alerted, waking it up from most sleeps and 494 * waits, but not probably very little in the I/O area (needs testing). On NT 495 * 3.50 and 3.1 VERR_NOT_IMPLEMENTED will be returned. 488 496 * 489 497 * @returns IPRT status code. … … 491 499 * @param hThread The thread to poke. This must not be the 492 500 * calling thread. 501 * 502 * @note This is *NOT* implemented on all platforms and may cause unresolved 503 * symbols during linking or VERR_NOT_IMPLEMENTED at runtime. 504 * 493 505 */ 494 506 RTDECL(int) RTThreadPoke(RTTHREAD hThread); -
trunk/src/VBox/Runtime/r3/win/init-win.cpp
r70361 r71150 84 84 /** NtDuplicateToken (NT 3.51). */ 85 85 DECLHIDDEN(PFNNTDUPLICATETOKEN) g_pfnNtDuplicateToken = NULL; 86 /** NtAlertThread (NT 3.51). */ 87 decltype(NtAlertThread) *g_pfnNtAlertThread = NULL; 86 88 87 89 /** Either ws2_32.dll (NT4+) or wsock32.dll (NT3.x). */ … … 513 515 g_pfnNtQueryFullAttributesFile = (PFNNTQUERYFULLATTRIBUTESFILE)GetProcAddress(g_hModNtDll, "NtQueryFullAttributesFile"); 514 516 g_pfnNtDuplicateToken = (PFNNTDUPLICATETOKEN)GetProcAddress( g_hModNtDll, "NtDuplicateToken"); 515 517 g_pfnNtAlertThread = (decltype(NtAlertThread) *)GetProcAddress( g_hModNtDll, "NtAlertThread"); 516 518 517 519 /* -
trunk/src/VBox/Runtime/r3/win/internal-r3-win.h
r70345 r71150 109 109 typedef NTSTATUS (NTAPI *PFNNTDUPLICATETOKEN)(HANDLE, ACCESS_MASK, struct _OBJECT_ATTRIBUTES *, BOOLEAN, TOKEN_TYPE, PHANDLE); 110 110 extern DECLHIDDEN(PFNNTDUPLICATETOKEN) g_pfnNtDuplicateToken; 111 #ifdef ___iprt_nt_nt_h___ 112 extern decltype(NtAlertThread) *g_pfnNtAlertThread; 113 #endif 111 114 112 115 extern DECLHIDDEN(HMODULE) g_hModWinSock; -
trunk/src/VBox/Runtime/r3/win/thread-win.cpp
r71127 r71150 45 45 #include <iprt/mem.h> 46 46 #include "internal/thread.h" 47 #include "internal-r3-win.h" 47 48 48 49 … … 400 401 RT_EXPORT_SYMBOL(RTThreadGetNativeHandle); 401 402 403 404 RTDECL(int) RTThreadPoke(RTTHREAD hThread) 405 { 406 AssertReturn(hThread != RTThreadSelf(), VERR_INVALID_PARAMETER); 407 if (g_pfnNtAlertThread) 408 { 409 PRTTHREADINT pThread = rtThreadGet(hThread); 410 AssertReturn(pThread, VERR_INVALID_HANDLE); 411 412 NTSTATUS rcNt = g_pfnNtAlertThread((HANDLE)pThread->hThread); 413 414 rtThreadRelease(pThread); 415 if (NT_SUCCESS(rcNt)) 416 return VINF_SUCCESS; 417 return RTErrConvertFromErrno(rcNt); 418 } 419 return VERR_NOT_IMPLEMENTED; 420 } 421
Note:
See TracChangeset
for help on using the changeset viewer.

