Skip to content

Instantly share code, notes, and snippets.

@TAbdiukov
Created July 25, 2024 19:00
Show Gist options
  • Save TAbdiukov/95560f903c44c94fb97dac857c8b0a62 to your computer and use it in GitHub Desktop.
Save TAbdiukov/95560f903c44c94fb97dac857c8b0a62 to your computer and use it in GitHub Desktop.
locking py
import threading
# Create a lock
lock = threading.Lock()
def is_free():
# Acquire the lock
with lock:
# code here
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment