Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2de2a56c44c30b5caa73b093669f13ff4a2fc212
Ticket: 674367ffffffffffffffffffffffffffffffffff
call for a function that is not thread safe
User & Date: elfring on 2003-01-27 20:07:44
Changes

  1. icomment:
    Logged In: YES 
    user_id=572001
    
    1. Please add your better explanation to the documentation.
    
    2. My intention is just to execute a single function calll under the 
    lock protection.
    But I think that I will not get the return code of the "unsafe" 
    function "open" in my first version of the example. I will get the 
    return value of the function call "thread::eval" instead. How do 
    you think about it?
    
    set $TID [thread::create -preserved]
    tsv::set X myMutex [thread::mutex create]
    thread::send $TID \
      {
       thread::eval -lock [tsv::get X myMutex] {catch {open Test.txt w} 
    Test}
       return $Test
      } File
    puts $File Hallo
    close $File
    thread::mutex destroy [tsv::get X myMutex]
    thread::release $TID
    
    Can the retrieval for return values from other threads made 
    easier?
    Does the second example show a use case that can be 
    supported by a single function in the TCL threads API?
    
    
  2. login: "elfring"
  3. mimetype: "text/plain"
  4. username: "elfring"