Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.hp.hpl.jena.shared
Class LockMRSW

    java.lang.Object
      com.hp.hpl.jena.shared.LockMRSW

All Implemented Interfaces:
  Lock

    public class LockMRSW

extends java.lang.Object
implements Lock

Lock implemenetation using a Multiple Reader, Single Writer policy. All the locking work is done by the imported WriterPreferenceReadWriteLock. Ths class adds:

- The same thread that acquired a lock should release it
- Lock promotion (turning read locks into write locks) is deteched as an error

Version:
  $Id: LockMRSW.java,v 1.5 2008/01/02 12:06:11 andy_seaborne Exp $
Author:
  Andy Seaborne

Field Summary

Fields inherited from interface com.hp.hpl.jena.shared.Lock
`READ, WRITE`

Constructor Summary
`LockMRSW()`

Method Summary
`void` | `enterCriticalSection(boolean readLockRequested)` Application controlled locking - enter a critical section.
`void` | `leaveCriticalSection()` Application controlled locking - leave a critical section.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### LockMRSW

    public LockMRSW()

Method Detail

### enterCriticalSection

    public final void enterCriticalSection(boolean readLockRequested)

  Application controlled locking - enter a critical section. Locking is reentrant so an application can have nested critical sections. Typical code:

        try {
           enterCriticalSection(Lock.READ) ;
           ... application code ...
        } finally { leaveCriticalSection() ; }

  Specified by:
    `enterCriticalSection` in interface `Lock`
  Parameters:
    `readLockRequested` - true implies a read lock,false implies write lock.
  See Also:
    `Lock.leaveCriticalSection()`

### leaveCriticalSection

    public final void leaveCriticalSection()

  Application controlled locking - leave a critical section.

  Specified by:
    `leaveCriticalSection` in interface `Lock`
  See Also:
    `enterCriticalSection(boolean)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP