GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — use functools.wraps for synchronized decorator · datagram-db/java2python@39d019a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • java2python/mod/include
    • sync.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎java2python/mod/include/sync.py‎

Copy file name to clipboardExpand all lines: java2python/mod/include/sync.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
from functools import wraps
12
from threading import RLock
23

34
def lock_for_object(obj, locks={}):
45
return locks.setdefault(id(obj), RLock())
56

67
def synchronized(call):
78
assert call.__code__.co_varnames[0] in {'self', 'cls'}
9+
@wraps(call)
810
def inner(*args, **kwds):
911
with lock_for_object(args[0]):
1012
return call(*args, **kwds)

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.