wait for threads to finish in a ruby wal