Acquiring a Lock on an Object

Q

What happens when a thread cannot acquire a lock on an object?

✍: FYIcenter

A

If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object's lock, it enters the waiting state until the lock becomes available.

2007-03-03, 4533👍, 0💬