Skip to content

Commit

Permalink
simplify cleanup state
Browse files Browse the repository at this point in the history
  • Loading branch information
mschubert committed Oct 10, 2023
1 parent ef98456 commit f5e5faf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions R/qsys_multicore.r
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ MULTICORE = R6::R6Class("MULTICORE",
},

children = list(),
is_cleaned_up = TRUE, #TODO:

finalize = function(quiet=FALSE) {
if (!private$is_cleaned_up) {
if (length(private$children) > 0) {
private$collect_children(wait=FALSE, timeout=0)
running = names(private$children)
if (length(running) > 0) {
Expand All @@ -60,7 +59,7 @@ MULTICORE = R6::R6Class("MULTICORE",
immediate.=TRUE)
tools::pskill(running, tools::SIGKILL)
}
private$is_cleaned_up = TRUE
private$children = list()
}
}
)
Expand Down

0 comments on commit f5e5faf

Please sign in to comment.