web_thread.c File : web_thread.c
Description : Thread Tracking functions for web_server
Category : Web Internal
Author : Charles Yates
THREAD_Init WEB_THREAD THREAD_Init( )
Function : THREAD_Init
Description : Creates a new thread tracking structure
Input : void
Output : void
Returns : WEB_THREAD - an initialised thread tracking structure
THREAD_GetFile int THREAD_GetFile( WEB_THREAD thread )
Function : THREAD_GetFile
Description : Returns the file descriptor associated to the thread
Input : WEB_THREAD thread - thread to enquire on
Output : void
Returns : int - file descriptor of thread (0 if not specified)
THREAD_GetCommon WEB_COMMON THREAD_GetCommon( WEB_THREAD thread )
Function : THREAD_GetCommon
Description : Returns the common structure of the thread
Input : WEB_THREAD thread - thread to enquire on
Output : void
Returns : WEB_COMMON - common structure assoicated to thread
THREAD_SetStatus void THREAD_SetStatus( WEB_THREAD thread, char *status )
Function : THREAD_SetStatus
Description : Set an arbitrary status on the thread (informational)
Input : WEB_THREAD thread - thread to use
char *status - informational message
Output : thread is updated with status info
Returns : void
THREAD_GetStatus char *THREAD_GetStatus( WEB_THREAD thread )
Function : THREAD_GetStatus
Description : Get the status info
Input : WEB_THREAD thread - thread to use
Output : void
Returns : returns the previously status
THREAD_Start int THREAD_Start( WEB_THREAD thread, void *worker( void * ) )
Function : THREAD_Start
Description : Start the thread
Input : WEB_THREAD thread - thread to use
void *func( void * ) - handling function
Output : thread is started
Returns : 0 for OK
THREAD_Wait WEB_STREAM THREAD_Wait( WEB_THREAD thread )
Function : THREAD_Wait
Description : Wait for the thread to be activated
Input : WEB_THREAD thread - thread to use
Output : thread is started
Returns : stream to use
THREAD_Activate int THREAD_Activate( WEB_THREAD thread, WEB_STREAM stream )
Function : THREAD_Activate
Description : Activate the thread with the given file descriptor
Input : WEB_THREAD thread - thread to use
int fd - file descriptor to be handled
Output : thread is activated
Returns : 0 for OK
THREAD_Stop void THREAD_Stop( WEB_THREAD thread )
Function : THREAD_Stop
Description : Deactivate the thread
Input : WEB_THREAD thread - thread to use
Output : thread is deactivated
Returns : void
THREAD_GetClients unsigned int THREAD_GetClients( WEB_THREAD thread )
Function : THREAD_GetClients
Description : Get the number of activations of this thread
Input : WEB_THREAD thread - thread to use
Output : void
Returns : number of activations on this thread
THREAD_UpdateCount void THREAD_UpdateCount( WEB_THREAD thread )
Function : THREAD_UpdateCount
Description : Increment the number of http requests received
Input : WEB_THREAD thread - thread to use
Output : void
Returns : void
THREAD_GetCount unsigned int THREAD_GetCount( WEB_THREAD thread )
Function : THREAD_GetCount
Description : Get the total number of http request received
Input : WEB_THREAD thread - thread to use
Output : void
Returns : number of http requests on this thread
THREAD_Close void THREAD_Close( WEB_THREAD thread )
Function : THREAD_Close
Description : Closes the thread tracker
Input : WEB_THREAD thread - thread to close
Output : void
Returns : void
Special Logic: Does not physically close the posix thread (see above)
|