replace pthread_cond with apr_thread_cond