C/C++ Reference
HttpCmdThreadPool.h
00001 /*
00002  *     ____             _________                __                _     
00003  *    / __ \___  ____ _/ /_  __(_)___ ___  ___  / /   ____  ____ _(_)____
00004  *   / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ /   / __ \/ __ `/ / ___/
00005  *  / _, _/  __/ /_/ / / / / / / / / / / /  __/ /___/ /_/ / /_/ / / /__  
00006  * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/  
00007  *                                                       /____/          
00008  *
00009  *                  Barracuda Embedded Web-Server 
00010  ****************************************************************************
00011  *            HEADER
00012  *
00013  *   $Id: HttpCmdThreadPool.h 2502 2011-12-16 18:10:01Z wini $
00014  *
00015  *   COPYRIGHT:  Real Time Logic, 2004 - 2005
00016  *               http://www.realtimelogic.com
00017  *
00018  *   The copyright to the program herein is the property of
00019  *   Real Time Logic. The program may be used or copied only
00020  *   with the written permission from Real Time Logic or
00021  *   in accordance with the terms and conditions stipulated in
00022  *   the agreement under which the program has been supplied.
00023  ****************************************************************************
00024  *
00025  */
00026 
00027 #ifndef _HttpCmdThreadPool_h
00028 #define _HttpCmdThreadPool_h
00029 
00030 
00031 #include <DoubleList.h>
00032 #include <HttpCmdThreadPoolIntf.h>
00033 
00034 struct HttpCmdThreadPool;
00035 
00036 typedef enum {
00037    HttpCmdThreadState_Idle,
00038    HttpCmdThreadState_RunDir,
00039    HttpCmdThreadState_Exit
00040 } HttpCmdThreadState;
00041 
00042 
00043 #ifndef __DOXYGEN__
00044 typedef struct
00045 {
00046       Thread super;
00047       DoubleLink node;
00048       ThreadSemaphore sem;
00049       struct HttpCmdThreadPool* pool;
00050       HttpCommand* cmd;
00051       HttpDir* dir;
00052       HttpCmdThreadState state;
00053 } HttpCmdThread;
00054 #endif
00055 
00073 typedef struct HttpCmdThreadPool
00074 {
00075 #ifdef __cplusplus
00076 
00091       HttpCmdThreadPool(
00092          HttpServer* server,ThreadPriority priority,int stackSize);
00093 
00106       ~HttpCmdThreadPool();
00107    private:
00108 #endif
00109       HttpCmdThreadPoolIntf super;
00110       DoubleList freeList;
00111       DoubleList runningList;
00112       SoDisp* dispatcher;
00113       HttpServer* server;
00114       HttpCmdThread* pool;
00115 #ifdef BA_SELECT_DISP
00116       ThreadSemaphore sem;
00117 #endif
00118 } HttpCmdThreadPool;
00119 
00120 
00121 
00122 #ifdef __cplusplus
00123 extern "C" {
00124 #endif
00125 BA_API void HttpCmdThreadPool_constructor(HttpCmdThreadPool* o,
00126                                           HttpServer* server,
00127                                           ThreadPriority priority,
00128                                           int stackSize);
00129 BA_API void HttpCmdThreadPool_destructor(HttpCmdThreadPool* o);
00130 #ifdef __cplusplus
00131 }
00132 inline HttpCmdThreadPool::HttpCmdThreadPool(HttpServer* server,
00133                                             ThreadPriority priority,
00134                                             int stackSize) {
00135    HttpCmdThreadPool_constructor(this, server, priority, stackSize); }
00136 inline HttpCmdThreadPool::~HttpCmdThreadPool() {
00137    HttpCmdThreadPool_destructor(this); }
00138 #endif
00139  /* end of ThreadLib group */
00141 
00142 
00143 #endif