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=7999, NAME=sleep, AT=2024-01-21 20:58:07.62
ps_suspend(p)
#> NULL
ps_status(p)
#> [1] "stopped"
ps_resume(p)
#> NULL
ps_status(p)
#> [1] "sleeping"
ps_kill(p)
#> NULL