117k views
4 votes
How does a thread acquire a lock?

1 Answer

2 votes

Answer:

The thread acquires a lock only if it it's available and not held by any other thread.

Step-by-step explanation:

This reduces blocking time of thread waiting for the lock. A thread that is in "waiting" State to acquire the access to synchronized block can't be interrupted.

User Beryl
by
8.6k points