add lock mutex per channel
add lock mutex per channel
use sem_trywait instead of sem_getvalue