Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
HttpCmdThreadPool.h
Go to the documentation of this file.
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 ****************************************************************************
11 * HEADER
12 *
13 * $Id: HttpCmdThreadPool.h 5978 2026-09-11 16:13:48Z 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
39#ifndef _HttpCmdThreadPool_h
40#define _HttpCmdThreadPool_h
41
42
43#include <DoubleList.h>
45
47
48typedef enum {
49 HttpCmdThreadState_Idle,
50 HttpCmdThreadState_RunDir,
51 HttpCmdThreadState_Exit
52} HttpCmdThreadState;
53
54
55#ifndef __DOXYGEN__
56typedef struct
57{
58 Thread super;
59 DoubleLink node;
61 struct HttpCmdThreadPool* pool;
62 HttpCommand* cmd;
63 HttpDir* dir;
64 HttpCmdThreadState state;
65} HttpCmdThread;
66#endif
67
81typedef struct HttpCmdThreadPool
82{
83#ifdef __cplusplus
84
103 HttpServer* server,ThreadPriority priority,int stackSize);
104
118 private:
119#endif
121 DoubleList freeList;
122 DoubleList runningList;
123 SoDisp* dispatcher;
124 HttpServer* server;
125 HttpCmdThread* pool;
127
128
129
130#ifdef __cplusplus
131extern "C" {
132#endif
141 HttpServer* server,
142 ThreadPriority priority,
143 int stackSize);
149#ifdef __cplusplus
150}
152 ThreadPriority priority,
153 int stackSize) {
154 HttpCmdThreadPool_constructor(this, server, priority, stackSize); }
157#endif
158 /* end of ThreadLib group */
160
161
162#endif
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:151
BA_API void HttpCmdThreadPool_destructor(HttpCmdThreadPool *o)
Wait for worker completion and detach the pool.
struct HttpCmdThreadPool HttpCmdThreadPool
An instance of this class provides a thread pool to an instance of the HttpServer class.
ThreadPriority
Portable priority choices, mapped to the target operating system.
Definition: ThreadLib.h:61
BA_API void HttpCmdThreadPool_constructor(HttpCmdThreadPool *o, HttpServer *server, ThreadPriority priority, int stackSize)
Create workers and bind the pool to a server.
~HttpCmdThreadPool()
Terminates all threads in the thread pool and deregisters the thread pool in the HttpServer instance.
Definition: HttpCmdThreadPool.h:155
Worker-pool dispatch interface borrowed by HttpServer.
Definition: HttpCmdThreadPoolIntf.h:63
An instance of this class provides a thread pool to an instance of the HttpServer class.
Definition: HttpCmdThreadPool.h:82
The HttpCommand class is a container class for the HttpRequest and HttpResponse command pair.
Definition: HttpServer.h:2151
An instance of the HttpDir class, which is a collection of zero or more resources,...
Definition: HttpServer.h:2777
The Web Server.
Definition: HttpServer.h:3393
The SoDisp dispatches any socket connection that contains data by calling the SoDispCon::execute memb...
Definition: SoDisp.h:91
A simple semaphore implementation.
Definition: ThreadLib.h:228
A simple thread class.
Definition: ThreadLib.h:261