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 or a list of process handles.

Examples

px <- processx::process$new("sleep", "10")
p <- ps_handle(px$get_pid())
p
#> <ps::ps_handle> PID=7570, NAME=sleep, AT=2024-10-29 08:52:11.01
ps_suspend(p)
#> NULL
ps_status(p)
#> [1] "stopped"
ps_resume(p)
#> NULL
ps_status(p)
#> [1] "sleeping"
ps_kill(p)
#> [1] "terminated"