Can each Java object keep track of all the threads that want to exclusively access to it?

Q

Can each Java object keep track of all the threads that want to exclusively access to it?

✍: Guest

A

Yes. Use Thread.currentThread() method to track the accessing thread.

2012-06-13, 2397👍, 0💬