Last thread identification?

Hi ,

Is there a way to find out when the last thread has been launched so that we can continue with the application?

what i mean is, say to calculate a value B I am using certain number of threads. when B is completely calculated i want to go ahead with the application in the same kernel itself. So I would like to identify when the final thread is launched ,so that, this can be used to do all the sequential calculations.

Thanks,
Randal