Thread.join

Waits until thread finishes, i.e. the function func, as given to Thread.new, returns or Thread.exit is called. If thread has already terminated, then Thread.join returns immediately.

Any thread can wait for any other thread by calling Thread.join, not just its 'creator'. Calling Thread.join from multiple threads for the same thread leads to undefined behaviour.

The value returned by func or given to Thread.exit is returned by this function.

Thread.join consumes the reference to the passed-in thread. This will usually cause the glib.Thread struct and associated resources to be freed. Use Thread.ref to obtain an extra reference if you want to keep the GThread alive beyond the Thread.join call.

class Thread
void*
join
()

Return Value

Type: void*

the return value of the thread