Static std::io::stdio::OUTPUT_CAPTURE_USED
source · static OUTPUT_CAPTURE_USED: AtomicBool
Expand description
Flag to indicate OUTPUT_CAPTURE is used.
If it is None and was never set on any thread, this flag is set to false, and OUTPUT_CAPTURE can be safely ignored on all threads, saving some time and memory registering an unused thread local.
Note about memory ordering: This contains information about whether a thread local variable might be in use. Although this is a global flag, the memory ordering between threads does not matter: we only want this flag to have a consistent order between set_output_capture and print_to within the same thread. Within the same thread, things always have a perfectly consistent order. So Ordering::Relaxed is fine.