Barracuda Application Server C/C++ Reference
NO
HttpCmdThreadPool.h
1 /*
2  * ____ _________ __ _
3  * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4  * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5  * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6  * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7  * /____/
8  *
9  * Barracuda Embedded Web-Server
10  ****************************************************************************
11  * HEADER
12  *
13  * $Id: HttpCmdThreadPool.h 4466 2019-11-08 20:11:49Z wini $
14  *
15  * COPYRIGHT: Real Time Logic LLC, 2004-2012
16  *
17  * This software is copyrighted by and is the sole property of Real
18  * Time Logic LLC. All rights, title, ownership, or other interests in
19  * the software remain the property of Real Time Logic LLC. This
20  * software may only be used in accordance with the terms and
21  * conditions stipulated in the corresponding license agreement under
22  * which the software has been supplied. Any unauthorized use,
23  * duplication, transmission, distribution, or disclosure of this
24  * software is expressly forbidden.
25  *
26  * This Copyright notice may not be removed or modified without prior
27  * written consent of Real Time Logic LLC.
28  *
29  * Real Time Logic LLC. reserves the right to modify this software
30  * without notice.
31  *
32  * http://www.realtimelogic.com
33  ****************************************************************************
34  *
35  */
36 
37 #ifndef _HttpCmdThreadPool_h
38 #define _HttpCmdThreadPool_h
39 
40 
41 #include <DoubleList.h>
42 #include <HttpCmdThreadPoolIntf.h>
43 
44 struct HttpCmdThreadPool;
45 
46 typedef enum {
47  HttpCmdThreadState_Idle,
48  HttpCmdThreadState_RunDir,
49  HttpCmdThreadState_Exit
50 } HttpCmdThreadState;
51 
52 
53 #ifndef __DOXYGEN__
54 typedef struct
55 {
56  Thread super;
57  DoubleLink node;
58  ThreadSemaphore sem;
59  struct HttpCmdThreadPool* pool;
60  HttpCommand* cmd;
61  HttpDir* dir;
62  HttpCmdThreadState state;
63 } HttpCmdThread;
64 #endif
65 
79 typedef struct HttpCmdThreadPool
80 {
81 #ifdef __cplusplus
82 
98  HttpServer* server,ThreadPriority priority,int stackSize);
99 
113  private:
114 #endif
115  HttpCmdThreadPoolIntf super;
116  DoubleList freeList;
117  DoubleList runningList;
118  SoDisp* dispatcher;
119  HttpServer* server;
120  HttpCmdThread* pool;
121 #ifdef BA_SELECT_DISP
122  ThreadSemaphore sem;
123 #endif
125 
126 
127 
128 #ifdef __cplusplus
129 extern "C" {
130 #endif
131 BA_API void HttpCmdThreadPool_constructor(HttpCmdThreadPool* o,
132  HttpServer* server,
133  ThreadPriority priority,
134  int stackSize);
135 BA_API void HttpCmdThreadPool_destructor(HttpCmdThreadPool* o);
136 #ifdef __cplusplus
137 }
139  ThreadPriority priority,
140  int stackSize) {
141  HttpCmdThreadPool_constructor(this, server, priority, stackSize); }
143  HttpCmdThreadPool_destructor(this); }
144 #endif
145  /* end of ThreadLib group */
147 
148 
149 #endif
SoDisp
The SoDisp dispatches any socket connection that contains data by calling the SoDispCon::execute memb...
Definition: SoDisp.h:86
ThreadPriority
ThreadPriority
Thread priority list.
Definition: ThreadLib.h:58
HttpCmdThreadPool::~HttpCmdThreadPool
~HttpCmdThreadPool()
Terminates all threads in the thread pool and deregisters the thread pool in the HttpServer instance.
Definition: HttpCmdThreadPool.h:142
HttpDir
An instance of the HttpDir class, which is a collection of zero or more resources,...
Definition: HttpServer.h:2384
Thread
A simple thread class.
Definition: ThreadLib.h:241
HttpCmdThreadPool
An instance of this class provides a thread pool to an instance of the HttpServer class.
Definition: HttpCmdThreadPool.h:80
HttpCmdThreadPool::HttpCmdThreadPool
HttpCmdThreadPool(HttpServer *server, ThreadPriority priority, int stackSize)
Create an instance of HttpCmdThreadPool and bind the thread pool to an instance of the HttpServer cla...
Definition: HttpCmdThreadPool.h:138
HttpCommand
The HttpCommand class is a container class for the HttpRequest and HttpResponse command pair.
Definition: HttpServer.h:1834
HttpCmdThreadPool
struct HttpCmdThreadPool HttpCmdThreadPool
An instance of this class provides a thread pool to an instance of the HttpServer class.
ThreadSemaphore
A simple semaphore implementation.
Definition: ThreadLib.h:213
HttpServer
The Web Server.
Definition: HttpServer.h:2887