void writeLock ( int count ) { if ( count > 0 && counter != null ) counter . acquireShared ( count ) ; sync . acquireShared ( 1 ) ; }
Acquires the write lock and consumes the specified amount of buffer space . Blocks if the object is currently locked for reading or if the buffer is full and count is greater than 0 .