View Single Post
Old 01-15-2003, 03:15 PM  
darkone
Disabled
 
darkone's Avatar
 
Join Date: Dec 2001
Posts: 2,230
Default

---

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
darkone is offline   Reply With Quote