~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Lib/logging/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
186
186
#the lock would already have been acquired - so we need an RLock.
187
187
#The same argument applies to Loggers and Manager.loggerDict.
188
188
#
189
 
_lock = None
 
189
if thread:
 
190
    _lock = threading.RLock()
 
191
else:
 
192
    _lock = None
190
193
 
191
194
def _acquireLock():
192
195
    """
194
197
 
195
198
    This should be released with _releaseLock().
196
199
    """
197
 
    global _lock
198
 
    if (not _lock) and thread:
199
 
        _lock = threading.RLock()
200
200
    if _lock:
201
201
        _lock.acquire()
202
202