TABLE OF CONTENTS


::pwtk::thread_wait

SYNOPSIS

proc ::pwtk::thread_wait {args} {

USAGE

   thread_wait ?thread_id? ?thread_id ...?

PURPOSE

Wait for the specified threads to finish.

If called without arguments, the command waits for all the treads to finish.

ARGUMENTS

SOURCE

    variable time_interval_ms
    
    if { $args eq "" } {
        set args [thread_ids]
    }
    if { [llength $args] == 1 } {
        set args [concat {*}$args]
    }

    print [concat Waiting for the threads $args to finish ...]\n
    foreach id $args {
        while { [::thread::exists $id] } {
            after $time_interval_ms
        }
    }
}