File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 strategy :
1616 fail-fast : false
1717 matrix :
18- os : [ubuntu-latest, macos-latest] # windows-latest disabled pending portability fixes
18+ os : [ubuntu-latest, macos-latest, windows-latest]
1919 runs-on : ${{ matrix.os }}
2020
2121 steps :
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ fn main() {
1010 Some ( "spawn-and-wait" ) => spawn_and_wait ( & args[ 1 ..] ) ,
1111 Some ( "spawn-chain" ) => spawn_chain ( & args[ 1 ..] ) ,
1212 Some ( "sleep" ) => std:: thread:: sleep ( std:: time:: Duration :: from_secs ( 1000 ) ) ,
13+ #[ cfg( unix) ]
1314 Some ( "spawn-own-pgroup" ) => spawn_own_pgroup ( & args[ 1 ..] ) ,
1415 _ => {
1516 eprintln ! (
@@ -55,6 +56,7 @@ fn spawn_chain(args: &[String]) {
5556 std:: thread:: sleep ( std:: time:: Duration :: from_secs ( 1000 ) ) ;
5657}
5758
59+ #[ cfg( unix) ]
5860fn spawn_own_pgroup ( args : & [ String ] ) {
5961 use std:: os:: unix:: process:: CommandExt ;
6062 use std:: sync:: atomic:: Ordering ;
@@ -90,8 +92,10 @@ fn spawn_own_pgroup(args: &[String]) {
9092 std:: thread:: sleep ( std:: time:: Duration :: from_secs ( 1000 ) ) ;
9193}
9294
95+ #[ cfg( unix) ]
9396static CHILD_PID_FOR_HANDLER : std:: sync:: atomic:: AtomicI32 = std:: sync:: atomic:: AtomicI32 :: new ( 0 ) ;
9497
98+ #[ cfg( unix) ]
9599extern "C" fn handle_sigterm ( _sig : libc:: c_int ) {
96100 let child_pid = CHILD_PID_FOR_HANDLER . load ( std:: sync:: atomic:: Ordering :: SeqCst ) ;
97101 if child_pid > 0 {
You can’t perform that action at this time.
0 commit comments