Lets assume a situation like this :
Lets say Thread0
access the lockObject
first and then Thread0
going to sleep for 1000ms.
synchronized(lockObject) {
Thread0.sleep(1000);
}
Thread1
also waiting for access the lockObject
.
What happened in these kind of situations? Is that context switching will pause for 1000ms because of the sleep(1000)?