cancel - cancel the execution one or more threads.
threads
or threadGroups.
Recall that a string can be used to identify a thread when supplied
to thread() or retrieved from the the
threadthread handle/object.
T, the call does not
return until each thread has acknowledged its
cancellation request. Otherwise, the call
just sends the request to each thread and
returns.
grp = threadGroup("name")
for(i in c(Quote({while(1) cat(n,connection=out)}), Quote(while(T){readLines(out,n=1)})) {
thread(i, group=grp)
}
tA = thread(Quote(for(i in 1:1000) print(i)))
cancel("name") # cancel the collection of threads in the threadGroup.
# name is a synonym for threadGroup grp
cancel(tA) # cancel the individual thread