Skip to content

Instantly share code, notes, and snippets.

@joar
Last active June 12, 2019 14:40
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 joar/706c71ffcbc5fd741b7ab9aaadc4efea to your computer and use it in GitHub Desktop.
Save joar/706c71ffcbc5fd741b7ab9aaadc4efea to your computer and use it in GitHub Desktop.
import threading
import dill
def main():
lock = threading.RLock()
dill_lock = dill.loads(dill.dumps(lock))
print(dill_lock) # Prints as "unlocked"
dill_lock.acquire() # Blocks forever
print("If I was brave enough I would call rm -rf / here.")
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment