q*h2013-11-12 08:112 楼使用 mutex 和 condition_variable 。C++ 的话,可参见 << C++ Concurrency In Action>> 里的相关实现。