In multiple thread programming,we usual use pthread_cond_wait to wait user specified condition becomes true,
it is true,but when we want to exit this thread,it is blocked because of the false condition because of the function
pthread_cond_wait(),so we must supply a friendly mechnism to exit thread normally.
The following statment is a case that I found in web.In the last,the author metioned three methods,
and 1st and 3st are recommended. In real life,I like use the 3st. I use it in my many projects.
It's perfect!
by zhangshaoyan at May 28,2015.