|
|
 |
tcl-threads
[Tcl-Threads] tsv locking
by yahalom other posts by this author
Dec 16 2003 6:25AM messages near this date
RE: [Tcl-Threads] Thread-safe Tcl Extensions
|
[Tcl-Threads] Is it possible to call the TCL interpreter from a C++ application, in a way that they will run in the same data block?
Hello
I tried to use the tsv::lock but it seems that the locking does not happen.
this is a test script. I would accept that only the first thread will be
able to enter the while loop but it seems that both thread enter it.
#
#
package require Thread
for {set j 0} {$j<2} {incr j} {
set threadId [thread::create]
thread::send -async $threadId {
set i 0
tsv::lock lock {
while {1} {
tsv::set lock i $i
puts "[thread::id]: [tsv::get lock i]"
after 1000
incr i
}
}
}
}
vwait forever
#
#
what am I doing wrong?
Thanks
Yahalom Emet
Software Developer
Xor Technologies Ltd.
Tel: +972 (0)4-6619164
E-mail: yahalomE@[...].com
Web: http://www.xortechnologies.com
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Tcl-Threads mailing list
Tcl-Threads@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-threads
|
|
|
 |
|