Posted to tcl by patthoyts at Thu Jul 31 23:41:52 GMT 2008view raw

  1. int
  2. TkWinSend_QueueCommand(
  3. Tcl_ThreadId tid,
  4. Tcl_Interp *interp,
  5. Tcl_Obj *cmdPtr)
  6. {
  7. SendEvent *evPtr;
  8.  
  9. TRACE("SendQueueCommand() tid %08x\n", (DWORD)Tcl_GetCurrentThread());
  10.  
  11. evPtr = (SendEvent *)ckalloc(sizeof(SendEvent));
  12. evPtr->header.proc = SendEventProc;
  13. evPtr->header.nextPtr = NULL;
  14. evPtr->interp = interp;
  15. evPtr->magic = 0x53454e44;
  16. Tcl_Preserve(evPtr->interp);
  17.  
  18. evPtr->cmdPtr = cmdPtr;
  19. if (Tcl_IsShared(cmdPtr)) {
  20. evPtr->cmdPtr = Tcl_DuplicateObj(cmdPtr);
  21. }
  22. Tcl_IncrRefCount(evPtr->cmdPtr);
  23.  
  24. Tcl_ThreadQueueEvent(tid, (Tcl_Event *)evPtr, TCL_QUEUE_TAIL);
  25. Tcl_ThreadAlert(tid);
  26.  
  27. return 0;
  28. }
  29.