nrlock.py revision 2029
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] 2029N/A# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 1271N/A# Rename some stuff so "from pkg.nrlock import *" is safe 2029N/A """Interface and implementation for Non-Reentrant locks. Derived from 2029N/A RLocks (which are reentrant locks). The default Python base locking 2029N/A type, threading.Lock(), is non-reentrant but it doesn't support any 2029N/A operations other than aquire() and release(), and we'd like to be 2029N/A able to support things like RLocks._is_owned() so that we can "assert" 2029N/A lock ownership assumptions in our code.""" 2029N/A """A boolean indicating whether the lock is currently locked.""" 2029N/A # Get stack of current owner, if lock is owned.