---
resource +lock <lockname>
Return: Always "", errors are fatal
---
resource -unlock <lockname>
Return: Always "", errors are fatal
---
Locking allows multiple threads to access same resource (file/environmental variable) with thread safe means.
-- Example use --
filereader.itcl:
resource +lock $filename
set data [gets $fchannel]
resource -unlock $filename
filewriter.itcl:
resource +lock $filename
puts $fchannel $data
resource -unlock $filename
|