wait on cond variable instead of sleeping
Merge branch 'c99' into ia