Skip to content

Suspend process execution with SIGSTOP preemptively checking whether PID has been reused. On Windows this has the effect of suspending all process threads.

Usage

ps_suspend(p = ps_handle())

Arguments

p

Process handle.

Examples

px <- processx::process$new("sleep", "10")
p <- ps_handle(px$get_pid())
p
#> <ps::ps_handle> PID=11715, NAME=sleep, AT=2022-06-18 08:49:00
ps_suspend(p)
#> NULL
ps_status(p)
#> [1] "stopped"
ps_resume(p)
#> NULL
ps_status(p)
#> [1] "sleeping"
ps_kill(p)
#> NULL