ipc: multi-pthread synchronize with mutex lock and condition variable