Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,13 @@
package require Thread
# How to create a mutex
set m [thread::mutex create]
# This will block if the lock is already held unless the mutex is made recursive
thread::mutex lock $m
# Now locked...
thread::mutex unlock $m
# Unlocked again
# Dispose of the mutex
thread::mutex destroy $m

View file

@ -0,0 +1,11 @@
set rw [thread::rwmutex create]
# Get and drop a reader lock
thread::rwmutex rlock $rw
thread::rwmutex unlock $rw
# Get and drop a writer lock
thread::rwmutex wlock $rw
thread::rwmutex unlock $rw
thread::rwmutex destroy $rw