children() -
obtain the vector of threads whose parent
is the given thread.
The natural parent of a thread is the value of self() where the call to thread() is evaluated. A thread can be created with a parent specified other than the natural parent using the parent argument to thread.
# wait until one of the threads sets the finished flag
getLock(lock, condition = Quote(finished == T)))
# kill all of the other children
cancel(children(), wait=T)