File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -965,7 +965,10 @@ pub fn arguments() []string {
965965// remain the same while the current process is running. It may or may not be
966966// equal to the value of v_gettid(). Note: it is *NOT equal on Windows*.
967967pub fn v_getpid () u64 {
968- $if windows {
968+ $if no_getpid ? {
969+ // support non posix/windows systems that lack process management
970+ return 0
971+ } $else $if windows {
969972 return u64 (C.GetCurrentProcessId ())
970973 } $else {
971974 return u64 (C.getpid ())
@@ -981,7 +984,10 @@ pub fn v_getpid() u64 {
981984// *avoid relying on this equivalence*, and use v_gettid and v_getpid only for
982985// tracing and debugging multithreaded issues, but *NOT for logic decisions*.
983986pub fn v_gettid () u64 {
984- $if windows {
987+ $if no_gettid ? {
988+ // support non posix/windows systems that lack process management
989+ return 0
990+ } $else $if windows {
985991 return u64 (C.GetCurrentThreadId ())
986992 } $else $if linux && ! musl ? {
987993 return u64 (C.gettid ())
You can’t perform that action at this time.
0 commit comments