Skip to content

Instantly share code, notes, and snippets.

@h3xh4wk
Created January 19, 2019 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h3xh4wk/245f9ec02aac01ee1a8ae2d630ed2418 to your computer and use it in GitHub Desktop.
Save h3xh4wk/245f9ec02aac01ee1a8ae2d630ed2418 to your computer and use it in GitHub Desktop.
Own object following the context manager protocol
import threading
some_lock = threading.lock()
with some_lock:
# Do something
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment