pub fn count_threads() -> usize {
	let out = if cfg!(any(target_os = "linux", target_os = "android")) {
		Command::new("ps")
			.arg("-eL")
			.output()
			.expect("failed to execute process")
	} else if cfg!(any(target_os = "macos", target_os = "ios")) {
		Command::new("ps")
			.arg("-eM")
			.output()
			.expect("failed to execute process")
	} else {
		unimplemented!()
	};
	out.stdout
		.split(|&x| x == b'\n')
		.skip(1)
		.filter(|x| !x.is_empty())
		.count()
}
/// Count the number of threads visible to this process. Counts the lines of `ps -eL` and equivalent minus one (the header).
Count the number of threads visible to this process. Counts the lines of `ps -eL` and equivalent minus one (the header).
Count the number of threads visible to this process . Counts the lines of ` ps - eL ` and equivalent minus one ( the header ) .
pub fn count_threads() -> usize {
	let out = if cfg!(any(target_os = "linux", target_os = "android")) {
		Command::new("ps")
			.arg("-eL")
			.output()
			.expect("failed to execute process")
	} else if cfg!(any(target_os = "macos", target_os = "ios")) {
		Command::new("ps")
			.arg("-eM")
			.output()
			.expect("failed to execute process")
	} else {
		unimplemented!()
	};
	out.stdout
		.split(|&x| x == b'\n')
		.skip(1)
		.filter(|x| !x.is_empty())
		.count()
}
pub fn count_threads ( ) -> usize { let out = if cfg ! ( any ( target_os " " target_os " " ) ) { Command :: new ( " " ) . arg ( " " ) . output ( ) . expect ( " " ) } else if cfg ! ( any ( target_os " " target_os " " ) ) { Command :: new ( " " ) . arg ( " " ) . output ( ) . expect ( " " ) } else { unimplemented ! ( ) } ; out . stdout . split ( | & x | x == b'\n' ) . skip ( 1 ) . filter ( | x | ! x . is_empty ( ) ) . count ( ) }
Count the number of threads visible to this process.
Count the number of threads visible to this process .