Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7649a5b980d482ef4685469633fa09449e59a477
Ticket: 923072ffffffffffffffffffffffffffffffffff
atfork patch
User & Date: das on 2006-05-27 12:26:27
Changes

  1. icomment:
    
    
    File Added - 179459: tclMacOSXNotify-atfork_HEAD.patch
    
    Logged In: YES 
    user_id=90580
    
    attached patch to HEAD that implements a pthread_atfork()
    handler for the Mac OS X specific notifier in
    tclMacOSXNotify.c (used when configured with
    --enable-corefoundation), this allows unthreaded CF tcl to
    [fork] without hanging at notifier finalization: the handler
    recreates CoreFoundation state and notifier thread in the child.
    Note that pthread_atfork() is available starting with OS X
    10.4 Tiger only, so tcl built on earlier releases will not
    include this fix.
    
    Because vfork() is used by the core  on OS X, the atfork
    handler does not run for [exec] and [open |], so core
    commands are not affected; the handler only gets called when
    an extension/embedder calls fork(), such as TclX's [fork].
    
    On Tiger, this makes [fork] safe to use from tcl with
    --disable-threads irrespective of corefoundation
    configuration option; but of course it doesn't fix the
    generic stale locked mutex issue with threaded tcl and fork
    also discussed here, so threaded CF tcl can still deadlock
    in the child if any locks are held in the parent at the time
    of the [fork].
    
    patch committed to HEAD and core-8-4-branch
    
    
  2. login: "das"
  3. mimetype: "text/plain"
  4. username: "das"