private void incrementThreadLockCount ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "incrementThreadLockCount" , this ) ; //get the current thread Thread currentThread = Thread . currentThread ( ) ; //get it's current read lock count LockCount count = ( LockCount ) readerThreads . get ( currentThread ) ; //if it doesn't exist, create it if ( count == null ) { count = new LockCount ( ) ; readerThreads . put ( currentThread , count ) ; } //increment the count if ( count . count == 0 ) readerThreadCount ++ ; count . count ++ ; readLockCount ++ ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "incrementThreadLockCount" ) ; }
The mutex must be held before calling this method .