tclthread.c File Reference

#include "nsd.h"

Data Structures

struct  ThreadArg

Functions

void NsTclInitAddrType (void)
int NsTclMutexObjCmd (ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj **objv)
int NsTclCritSecObjCmd (ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj **objv)
int NsTclSemaObjCmd (ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj **objv)
int NsTclCondObjCmd (ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj **objv)
int NsTclRWLockObjCmd (ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj **objv)
int NsTclThreadObjCmd (ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj **objv)
int Ns_TclThread (Tcl_Interp *interp, char *script, Ns_Thread *thrPtr)
int Ns_TclDetachedThread (Tcl_Interp *interp, char *script)
void NsTclThread (void *arg)
void NsTclThreadArgProc (Tcl_DString *dsPtr, void *arg)

Function Documentation

int Ns_TclDetachedThread ( Tcl_Interp *  interp,
char *  script 
)

----------------------------------------------------------------------

Ns_TclDetachedThread --

Run a Tcl script in a detached thread.

Results: NS_OK.

Side effects: None.

----------------------------------------------------------------------

int Ns_TclThread ( Tcl_Interp *  interp,
char *  script,
Ns_Thread *  thrPtr 
)

----------------------------------------------------------------------

Ns_TclThread --

Run a Tcl script in a new thread.

Results: NS_OK.

Side effects: None.

----------------------------------------------------------------------

int NsTclCondObjCmd ( ClientData  data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj **  objv 
)

----------------------------------------------------------------------

NsTclCondObjCmd --

Implements ns_cond and ns_event.

Results: See docs.

Side effects: See docs.

----------------------------------------------------------------------

int NsTclCritSecObjCmd ( ClientData  data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj **  objv 
)

----------------------------------------------------------------------

NsTclCritSecObjCmd --

Implements ns_critsec.

Results: Tcl result.

Side effects: See doc.

----------------------------------------------------------------------

void NsTclInitAddrType ( void   ) 

----------------------------------------------------------------------

NsTclInitAddrType --

Initialize the Tcl address object type.

Results: None.

Side effects: None.

----------------------------------------------------------------------

int NsTclMutexObjCmd ( ClientData  data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj **  objv 
)

----------------------------------------------------------------------

NsTclMutexObjCmd --

Implements ns_mutex as obj command.

Results: Tcl result.

Side effects: See docs.

----------------------------------------------------------------------

int NsTclRWLockObjCmd ( ClientData  data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj **  objv 
)

----------------------------------------------------------------------

NsTclRWLockObjCmd --

Implements ns_rwlock.

Results: Tcl result.

Side effects: See docs.

----------------------------------------------------------------------

int NsTclSemaObjCmd ( ClientData  data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj **  objv 
)

----------------------------------------------------------------------

NsTclSemaObjCmd --

Implements ns_sema.

Results: Tcl result.

Side effects: See docs.

----------------------------------------------------------------------

void NsTclThread ( void *  arg  ) 

----------------------------------------------------------------------

NsTclThread --

Tcl thread main.

Results: None.

Side effects: Copy of string result is return as exit arg to be reaped by ns_thread wait.

----------------------------------------------------------------------

Need to ensure that the server has completed it's initializtion prior to initiating TclEval.

void NsTclThreadArgProc ( Tcl_DString *  dsPtr,
void *  arg 
)

----------------------------------------------------------------------

NsTclThreadArgProc --

Proc info routine to copy Tcl thread script.

Results: None.

Side effects: Will copy script to given dstring.

----------------------------------------------------------------------

int NsTclThreadObjCmd ( ClientData  arg,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj **  objv 
)

----------------------------------------------------------------------

NsTclThreadObjCmd --

Implements ns_thread to get data on the current thread and create and wait on new Tcl-script based threads. New threads will be created in the virtual-server context of the current interp, if any.

Results: Standard Tcl result.

Side effects: May create a new thread or wait for an existing thread to exit.

----------------------------------------------------------------------


Generated on Tue Sep 4 19:58:56 2007 by  doxygen 1.5.1