01: /*
02: File: ReaderPreferenceReadWriteLock.java
03:
04: Originally written by Doug Lea and released into the public domain.
05: This may be used for any purposes whatsoever without acknowledgment.
06: Thanks for the assistance and support of Sun Microsystems Labs,
07: and everyone contributing, testing, and using this code.
08:
09: History:
10: Date Who What
11: 11Jun1998 dl Create public version
12: */
13:
14: package EDU.oswego.cs.dl.util.concurrent;
15:
16: /**
17: * A ReadWriteLock that prefers waiting readers over
18: * waiting writers when there is contention. The range of applicability
19: * of this class is very limited. In the majority of situations,
20: * writer preference locks provide more reasonable semantics.
21: *
22: * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
23: **/
24:
25: public class ReaderPreferenceReadWriteLock extends
26: WriterPreferenceReadWriteLock {
27: protected boolean allowReader() {
28: return activeWriter_ == null;
29: }
30: }
|