Fix synchronization to use BlockingQueue instead of wait/notify.

The current synchronization model using wait/notify has possibility of deadlock.
By modifying synchronization model to use BlockingQueue instead of wait/notify, all causes of deadlock will be removed completely.