I think that the second option is the good one.
The code should be something like this:
public void lock(int recordNumber)
{
synchronized(theRecordArray[recordNumber])
{
do it...
}
}
this only works if theRecordArray contains Object
Hope it helps!!!!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.