nrlock.py revision 2028
1271N/A# The contents of this file are subject to the terms of the 1271N/A# Common Development and Distribution License (the "License"). 1271N/A# You may not use this file except in compliance with the License. 1271N/A# See the License for the specific language governing permissions 1271N/A# and limitations under the License. 1271N/A# When distributing Covered Code, include this CDDL HEADER in each 1271N/A# If applicable, add the following below this CDDL HEADER, with the 1271N/A# fields enclosed by brackets "[]" replaced with your own identifying 1271N/A# information: Portions Copyright [yyyy] [name of copyright owner] 1271N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 1271N/A# Use is subject to license terms. 1271N/A# Rename some stuff so "from pkg.nrlock import *" is safe 1693N/A """Interface and implementation for Non-Reentrant locks. Derived from 1693N/A RLocks (which are reentrant locks). The default Python base locking 1693N/A type, threading.Lock(), is non-reentrant but it doesn't support any 1693N/A operations other than aquire() and release(), and we'd like to be able 1693N/A to support things like RLocks._is_owned() so that we can "assert" lock 1693N/A ownership assumptions in our code.""" 2028N/A """A boolean indicating whether the lock is currently locked.""" 1693N/A return "recursive NRLock acquire"