mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-01-13 01:59:01 +00:00
Minor update
This commit is contained in:
@@ -103,6 +103,17 @@ def stackedmethod(f):
|
||||
return _
|
||||
|
||||
def lockedmethod(f):
|
||||
"""
|
||||
Decorates a function or method with a reentrant lock (only one thread can execute the function at a time)
|
||||
|
||||
>>> @lockedmethod
|
||||
... def recursive_count(n):
|
||||
... if n <= 0: return 0
|
||||
... return n + recursive_count(n - 1)
|
||||
>>> recursive_count(5)
|
||||
15
|
||||
"""
|
||||
|
||||
lock = threading.RLock()
|
||||
|
||||
@functools.wraps(f)
|
||||
|
||||
Reference in New Issue
Block a user