use condition variable to wake another thread instead of using socket write