Re: vwait doesn't return after setting TCL_SetVar from a thread



Ziv Haziz wrote:
two last questions...
1. if i will use the thread package in the tcl level i will need to do
TCL_ThreadQueue instead of TCL_queue right? how could i tell whay will
be the relevant Q? how to make sure that the event will go to the
relevant thread?

The man page explains the difference. Tcl_ThreadQueueEvent queues new events to
the particular thread in the params. Tcl_QueueEvent queues to the current thread
the function is being called from. Tcl_ThreadQueueEvent only exists when the core
you are using has been compiled for thread support.


2. in your code you have wrapped the TCLEvent pointer with additional
data (TCL_interp pointer) this is your code:

DataReadyEvent *evPtr
.
.
.
Tcl_QueueEvent((Tcl_Event *)evPtr

when i tried to pass similar pointer (with the following structure) with
the same casting.
typedef struct {
Tcl_Event* header;
Tcl_Interp *interp;
TCL_Var2Set Var2set;


} EventData;
the tclsh crushed - if you could elaborate how your conversion was
accepted by the tclsh.


The 'header' should not be a pointer. Should be:

typedef struct {
Tcl_Event header;
Tcl_Interp *interp;
Tcl_Var2Set Var2set;
} EventData;


--
Calvin: Sometimes when I'm talking, my words can't keep up with my thoughts.
I wonder why we think faster than we speak. Hobbes: Probably so we can think
twice.

Attachment: signature.asc
Description: OpenPGP digital signature



Relevant Pages

  • Re: Header Files and Interfaces Yet Again
    ... I get a foo.h user's header file ... Java's assignments are pointer assignments. ... If for some reason I'm forced to violate ...
    (comp.lang.cpp)
  • Multiple Double Linked Lists
    ... string is a string of characters representing the identifier itself. ... typedef struct Names DLList; ... typedef struct header *headerpt; ...
    (comp.lang.c)
  • Re: Separated headers
    ... and now I want to separate headers from code. ... I guess I need one more pointer in the header like this: ... \>XXXX and XXXX> move to and from a specific data area, ...
    (comp.lang.forth)
  • Re: komplexes Problem mit Funktionszeigern
    ... Es sind Header vorhanden, ... Pointer aufgerufen wird. ... So unterschiedlich sind diese Konventionen offensichtlich nicht. ... Schnittstelle besitzen, und für diese Schnittstelle passende Header ...
    (de.comp.lang.c)
  • Re: allocating memory for array of pointers to char
    ... > checking up on allocation and so on, the types of your objects are ... > bits-zero is not guaranteed to be a null pointer. ... This is also the first time I've used linked lists, ... typedef struct listelem_t { ...
    (comp.lang.c)