Wait added for receive thread.

Wait added for receive thread.