Thread - Wait callback
// The object that will wait the other thread to unlock
final Object syncObject = new Object();
// Stop and Wait
synchronized (syncObject){
try {
syncObject.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
// Release the lock and continue
synchronized (syncObject){
syncObject.notify();
}