Threading in Java: How to lock an object?

In order to call wait() on an object, you have to hold the synchronized lock on that object (though the lock is actually released while the thread is waiting):

synchronized (serverAddr) {
  serverAddr.wait();
}

I have to admit that why you’re wanting to do this baffles me in this case…

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)