Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0ce8734810cc0c779720d9867bdd98a6b4531814
Ticket: 217951ffffffffffffffffffffffffffffffffff
Tcl_AsyncMark yields the wrong thread (more follow-up)
User & Date: nobody on 2000-10-26 00:46:31
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 3952 Bug
    Version: 8.3b1
    SubmitDate: '1999-12-28'
    LastModified: '2000-07-25'
    Severity: LOW
    Status: Closed
    Submitter: techsupp
    ChangedBy: davidg
    RelatedBugIDs: 5791
    OS: Windows 2000
    FixedDate: '2000-07-25'
    FixedInVersion: 8.4a1
    ClosedDate: '2000-10-25'
    
    
    Name:
    
    David Gravereaux
    
    
    
    CVS:
    
    I updated today
    
    
    
    CustomShell:
    
    tclAsync.c changes in progress
    
    
    
    Comments:
    
    The unix notifier still needs a wake-up method like the windows' 
    
    TclpAsyncMark.  The tclAsync.c patches aren't complete without it.
    
    
    
    ObservedBehavior:
    
    Looks like TclpAsyncMark should reside in tclWinNotify.c rather than
    
    tclWinInit.c for purely asthetic reasons.  I forgot the prototype
    
    change to TclpAsyncMark in the original patch.
    
    
    
    Patch:
    
    Index: tclWinInit.c
    
    ===================================================================
    
    RCS file: /cvsroot/tcl/win/tclWinInit.c,v
    
    retrieving revision 1.21
    
    diff -c -r1.21 tclWinInit.c
    
    *** tclWinInit.c1999/12/09 14:44:111.21
    
    --- tclWinInit.c1999/12/28 04:10:10
    
    ***************
    
    *** 815,845 ****
    
              Tcl_DStringFree(&temp);
    
          }
    
      }
    
    - 
    
    
    
    - /*
    
    -  *----------------------------------------------------------------------
    
    -  *
    
    -  * TclpAsyncMark --
    
    -  *
    
    -  *Wake up the main thread from a signal handler.
    
    -  *
    
    -  * Results:
    
    -  *None.
    
    -  *
    
    -  * Side effects:
    
    -  *Sends a message to the main thread.
    
    -  *
    
    -  *----------------------------------------------------------------------
    
    -  */
    
    - 
    
    - void
    
    - TclpAsyncMark(async)
    
    -     Tcl_AsyncHandler async;/* Token for handler. */
    
    - {
    
    -     /*
    
    -      * Need a way to kick the Windows event loop and tell it to go look at
    
    -      * asynchronous events.
    
    -      */
    
    - 
    
    -     PostThreadMessage(mainThreadId, WM_USER, 0, 0);
    
    - }
    
    --- 815,817 ----
    
    Index: tclWinNotify.c
    
    ===================================================================
    
    RCS file: /cvsroot/tcl/win/tclWinNotify.c,v
    
    retrieving revision 1.5
    
    diff -c -r1.5 tclWinNotify.c
    
    *** tclWinNotify.c1999/07/02 22:08:281.5
    
    --- tclWinNotify.c1999/12/28 04:10:11
    
    ***************
    
    *** 512,514 ****
    
    --- 512,542 ----
    
      {
    
          Sleep(ms);
    
      }
    
    + 
    
    
    
    + /*
    
    +  *----------------------------------------------------------------------
    
    +  *
    
    +  * TclpAsyncMark --
    
    +  *
    
    +  *Wake up the main thread from a signal handler.
    
    +  *
    
    +  * Results:
    
    +  *None.
    
    +  *
    
    +  * Side effects:
    
    +  *Sends a message to the main thread.
    
    +  *
    
    +  *----------------------------------------------------------------------
    
    +  */
    
    + 
    
    + void
    
    + TclpAsyncMark(threadId)
    
    +     Tcl_ThreadId threadId;/* Thread ID from async token. */
    
    + {
    
    +     /*
    
    +      * Need a way to kick the Windows event loop and tell it to go look at
    
    +      * asynchronous events.
    
    +      */
    
    + 
    
    +     PostThreadMessage((DWORD)threadId, WM_USER, 0, 0);
    
    + }
    
    Index: tclInt.decls
    
    ===================================================================
    
    RCS file: /cvsroot/tcl/generic/tclInt.decls,v
    
    retrieving revision 1.19
    
    diff -c -r1.19 tclInt.decls
    
    *** tclInt.decls1999/12/12 22:46:421.19
    
    --- tclInt.decls1999/12/28 04:11:17
    
    ***************
    
    *** 792,798 ****
    
          void TclWinAddProcess(HANDLE hProcess, DWORD id)
    
      }
    
      declare 21 win {
    
    !     void TclpAsyncMark(Tcl_AsyncHandler async)
    
      }
    
      
    
      # Added in 8.1:
    
    --- 792,798 ----
    
          void TclWinAddProcess(HANDLE hProcess, DWORD id)
    
      }
    
      declare 21 win {
    
    !     void TclpAsyncMark(Tcl_ThreadId threadId)
    
      }
    
      
    
      # Added in 8.1:
    
    
    
    PatchFiles:
    
    win/tclWinInit.c win/tclWinNotify.c generic/tclInt.decls
    
    
    
    
    
    #5791 integrated. 
    -- 07/25/2000 davidg
    
  4. foundin changed to: "obsolete: 8.3b1"
  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:
    Tcl_AsyncMark yields the wrong thread (more follow-up)
    
  11. type changed to: "Bug"