forked from bparli/fastping-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use thread::Builder API instead of ::spawn
`thread::spawn` panics on failure. The `Builder` allows us to pass any errors back up to the caller. We can also give the threads a name, which is often useful in debugging. Example from a Linux machine: ``` $ ps -eLl F S UID PID SPID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD ... 4 S 0 4073149 4073149 4068718 0 80 0 - 51875 - pts/0 00:00:00 ping 1 S 0 4073149 4073150 4068718 0 80 0 - 51875 - pts/0 00:00:00 pnet-v4-listene 1 S 0 4073149 4073151 4068718 0 80 0 - 51875 - pts/0 00:00:00 pnet-v6-listene 1 S 0 4073149 4073152 4068718 0 80 0 - 51875 - pts/0 00:00:00 pinger ... ```
- Loading branch information
Showing
3 changed files
with
29 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters