We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
SwitchToThread
Sleep(0)
1 parent 40b1e40 commit 07002fbCopy full SHA for 07002fb
library/std/src/sys/windows/c.rs
@@ -406,6 +406,17 @@ compat_fn_with_fallback! {
406
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
407
FALSE
408
}
409
+
410
+ // >= NT 4+
411
+ // https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-switchtothread
412
+ pub fn SwitchToThread() -> BOOL {
413
+ // A value of zero causes the thread to relinquish the remainder of its time slice to any
414
+ // other thread of equal priority that is ready to run. If there are no other threads of
415
+ // equal priority ready to run, the function returns immediately, and the thread continues
416
+ // execution.
417
+ Sleep(0);
418
+ TRUE
419
+ }
420
421
422
compat_fn_lazy! {
0 commit comments