Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

[newbie] Reentrantlock() use issue

807601Jan 13 2008 — edited Jan 13 2008
Once again another thing I really can't understand is the way java "imports" the different classes and functions to a particular application.
I created a class that need to create a ReentrantLock object.
A ReentrantLock is owned by the thread last successfully locking, but not yet unlocking it. 
A thread invoking lock will return, successfully acquiring the lock, when the lock is not owned by another thread.
That's the object that matches the closiest to the MUTEX concept. That's why I needed to use this Class.

When trying to compile I got this kinf of message well known:
symbol  : class ReentrantLock
location: class consultservice.Main
        ReentrantLock MyMutex=new ReentrantLock();
However I import java.util.* or java.util.concurrent.*

Is anybody can explain me how to use this Class ?
Thank you !!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 10 2008
Added on Jan 13 2008
2 comments
57 views