cec: extracted a thread class. fixed bug: pthread_cond_wait was called without the...