reworked thread wait. Segfaults now on epcc.