As Firo mentions, you want to use one of the event based wait handlers (AutoResetEvent or ManualResetEvent) for this. They are designed for exactly what you ask here: waiting until something happens in another thread at an unknown time.
class Test {
AutoResetEvent waitHandle = new AutoResetEvent(false);
void SpawnThread(){
Thread t = new Thread(ThreadMethod);
t.Start();
}
void ThreadMethod(){
waitHandle.WaitOne();
CanFrame consecutiveFrame = _fragmentedFrameQueue.Dequeue();
PublishFrame(consecutiveFrame);
}
void SomeLongOtherMethod(){
DoStuffThatTakesAWhile();
waitHandle.Set();
}
}
You should never wait by using a tight loop. That will run a core at 100% CPU and make your app unpopular. Wait handles, and Thread.Sleep as well, are OS level triggers and put your thread into a non-running state that doesn't use CPU time.