Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c70e68e2391a449e9a7fe5a31456f088a66c565f
Ticket: 217981ffffffffffffffffffffffffffffffffff
fix proposal for TR#5312
User & Date: nobody on 2000-10-26 00:47:07
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 5793 Bug
    Version: 8.4a1
    SubmitDate: '2000-06-02'
    LastModified: '2000-07-19'
    Severity: MED
    Status: Closed
    Submitter: techsupp
    ChangedBy: davidg
    RelatedBugIDs: 5829
    OS: Windows NT
    FixedDate: '2000-07-19'
    ClosedDate: '2000-10-25'
    
    
    Name:
    
    David Gravereaux
    
    
    
    CVS:
    
    updated today
    
    
    
    Comments:
    
    This isn't working yet, but the idea for how to do it might be for
    
        you core guys.  At least it's a good starting point.  Maybe I'll
    
        run this in the debugger tomorrow and look for good ways to unblock
    
        tclsh from it's infinite GetConsole wait so I can post a 
    
        Tcl_Eval(..., "::exit");
    
        
    
        just my $0.02
    
    
    
    ObservedBehavior:
    
    control-c causes tclsh84 (built for threads) to crash rather than
    
    exit cleanly.
    
    
    
    Patch:
    
    *** tclAppInit.c1999/12/02 02:03:371.6
    
    --- tclAppInit.c2000/06/02 08:26:32
    
    ***************
    
    *** 29,35 ****
    
    --- 29,39 ----
    
      #endif /* TCL_TEST */
    
      
    
      static voidsetargv _ANSI_ARGS_((int *argcPtr, char ***argvPtr));
    
    + static BOOL __stdcallCtrlHandler _ANSI_ARGS_((DWORD fdwCtrlType));
    
      
    
    + Tcl_AsyncHandlerexitToken;
    
    + Tcl_AsyncProcasyncExit;
    
    + 
    
      
    
      /*
    
       *----------------------------------------------------------------------
    
    ***************
    
    *** 156,161 ****
    
    --- 160,168 ----
    
                  Procbodytest_SafeInit);
    
      #endif /* TCL_TEST */
    
      
    
    +     SetConsoleCtrlHandler(CtrlHandler, TRUE);
    
    +     exitToken = Tcl_AsyncCreate(asyncExit, (ClientData) interp);
    
    + 
    
          /*
    
           * Call the init procedures for included packages.  Each call should
    
           * look like this:
    
    ***************
    
    *** 298,301 ****
    
    --- 305,356 ----
    
      
    
          *argcPtr = argc;
    
          *argvPtr = argv;
    
    + }
    
    + 
    
    + /*
    
    +  *----------------------------------------------------------------------
    
    +  *
    
    +  * asyncExit --
    
    +  *
    
    +  *The AsyncProc for the exitToken.
    
    +  *
    
    +  * Results:
    
    +  *doesn't actually return.
    
    +  *
    
    +  * Side effects:
    
    +  *tclsh cleanly exits.
    
    +  *
    
    +  *----------------------------------------------------------------------
    
    +  */
    
    + 
    
    + int asyncExit (ClientData clientData, Tcl_Interp *interp, int code)
    
    + {
    
    +     char *cmd = "::exit";
    
    + 
    
    +     Tcl_Eval((Tcl_Interp *) clientData, cmd);
    
    +     return code;
    
    + }
    
    + 
    
    + /*
    
    +  *----------------------------------------------------------------------
    
    +  *
    
    +  * CtrlHandler --
    
    +  *
    
    +  *Signal handler for the Win32 OS.  Catches Ctrl+C, Ctrl+break and
    
    +  *other exits.  This is needed so tclsh can do it's real clean-up
    
    +  *and not an unclean crash terminate.
    
    +  *
    
    +  * Results:
    
    +  *True to notify the OS we'll handle this ourselves.
    
    +  *
    
    +  * Side effects:
    
    +  *effects the way the app exits from a signal.
    
    +  *
    
    +  *----------------------------------------------------------------------
    
    +  */
    
    + 
    
    + BOOL __stdcall CtrlHandler (DWORD fdwCtrlType)
    
    + {
    
    +     Tcl_AsyncMark(exitToken);
    
    +     return TRUE;
    
      }
    
    
    
    PatchFiles:
    
    tclAppInit.c
    
    
    
    
    
    see 5829 
    -- 07/19/2000 davidg
    
  4. foundin changed to: "obsolete: 8.4a1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "49. Threading"
  10. title changed to: "fix proposal for TR#5312"
  11. type changed to: "Bug"