add count: use lock and cond