I am programming in C++ Builder 5 and I am communicating on a serial port. I want to call my communication routine and then stop program execution until I have processed the response. I have tried a while loop with a no op, but that seems to stop everything. I want my main routine to sit and wait until my comm routine sets a flag saying that I have received data.

Any ideas?