Skip to content

Commit

Permalink
replace lock with RLock to avoid deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
tavis_rudd committed Nov 14, 2007
1 parent f84cdad commit 16612e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ Please initial your changes (there's a key at bottom) and add a date for each
release
================================================================================

2.0.1 (unreleased)
- fixed a deadlock Christoph Zwerschke found in Cheetah.ImportHooks.
[TR]

2.0 (Oct 12, 2007)
!!!THIS RELEASE REQUIRES RECOMPILATION OF ALL COMPILED CHEETAH TEMPLATES!!!

Expand Down
12 changes: 6 additions & 6 deletions src/ImportHooks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# $Id: ImportHooks.py,v 1.25 2006/06/20 19:23:27 tavis_rudd Exp $
# $Id: ImportHooks.py,v 1.26 2007/11/14 23:16:08 tavis_rudd Exp $

"""Provides some import hooks to allow Cheetah's .tmpl files to be imported
directly like Python .py modules.
Expand All @@ -13,20 +13,20 @@
Author: Tavis Rudd <tavis@damnsimple.com>
License: This software is released for unlimited distribution under the
terms of the MIT license. See the LICENSE file.
Version: $Revision: 1.25 $
Version: $Revision: 1.26 $
Start Date: 2001/03/30
Last Revision Date: $Date: 2006/06/20 19:23:27 $
Last Revision Date: $Date: 2007/11/14 23:16:08 $
"""
__author__ = "Tavis Rudd <tavis@damnsimple.com>"
__revision__ = "$Revision: 1.25 $"[11:-2]
__revision__ = "$Revision: 1.26 $"[11:-2]

import sys
import os.path
import types
import __builtin__
import new
import imp
from threading import Lock
from threading import RLock
import string
import traceback
from Cheetah import ImportManager
Expand All @@ -48,7 +48,7 @@ def setCacheDir(cacheDir):
## CLASSES

class CheetahDirOwner(DirOwner):
_lock = Lock()
_lock = RLock()
_acquireLock = _lock.acquire
_releaseLock = _lock.release

Expand Down

0 comments on commit 16612e7

Please sign in to comment.