You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
They should be changed to output the proper process and thread id.
Suggestion: use std::process::id() for the PID and std::thread::current().id() for the TID. The only problem is that the ThreadId type in the standard library cannot be trivially converted to a primitive type (int/uint/usize), without using any hacks. Also, ThreadIds are under the control of Rust’s standard library and there may not be any relationship between ThreadId and the underlying platform’s notion of a thread identifier (see the official docs). There's a proposal for stabilizing a u64 conversion, though (see this tracking issue)
The text was updated successfully, but these errors were encountered:
Currently, PID and TID are hardcoded to show only the constant "1":
They should be changed to output the proper process and thread id.
Suggestion: use
std::process::id()
for the PID andstd::thread::current().id()
for the TID. The only problem is that theThreadId
type in the standard library cannot be trivially converted to a primitive type (int/uint/usize), without using any hacks. Also,ThreadIds
are under the control of Rust’s standard library and there may not be any relationship betweenThreadId
and the underlying platform’s notion of a thread identifier (see the official docs). There's a proposal for stabilizing a u64 conversion, though (see this tracking issue)The text was updated successfully, but these errors were encountered: