I want to make a thread sleep until other thread complete its work.
But I could not find methods that make a thread sleep or wake up.
I think I can do it by using lock and unlock.
Bellow is my idea that makes thread1 sleep until thread 2 finish its work.
But VC2005 recognize it as a deadlock.
- Code: Select all
// do one's work
I think I can avoid VS2005's false deadlock detection by using additional lock variable.
But it seems a little complex.
Is there someone who haver better idea?
plz help me.
Thanks to read.