Barracuda Application Server C/C++ Reference
NO
Thread handling

Detailed Description

See also
Barracuda Introduction

Classes

struct  ThreadLock
 This class provides an easy and less error prone way of locking and releasing a mutex. More...
 
struct  ThreadReleaseLock
 This class provides an easy and less error prone way of temporarily releasing a locked mutex. More...
 
struct  ThreadMutex
 A mutual exclusion class. More...
 
struct  ThreadSemaphore
 A simple semaphore implementation. More...
 
struct  Thread
 A simple thread class. More...
 
struct  HttpCmdThreadPool
 An instance of this class provides a thread pool to an instance of the HttpServer class. More...
 

Typedefs

typedef void(* Thread_Run) (struct Thread *th)
 Prototype for the thread run method.
 
typedef struct HttpCmdThreadPool HttpCmdThreadPool
 An instance of this class provides a thread pool to an instance of the HttpServer class. More...
 

Enumerations

enum  ThreadPriority
 Thread priority list. More...
 

Functions

 ThreadLock::ThreadLock (ThreadMutex &m)
 Lock a region of code.
 
 ThreadLock::ThreadLock (ThreadMutex *m)
 Lock a region of code.
 
 ThreadLock::~ThreadLock ()
 Unlock the mutex.
 
 ThreadReleaseLock::ThreadReleaseLock (struct HttpRequest *req)
 Temporarily unlock a locked mutex from within a resource.
 
 ThreadReleaseLock::ThreadReleaseLock (ThreadMutex &m)
 Temporarily unlock a locked mutex.
 
 ThreadReleaseLock::ThreadReleaseLock (ThreadMutex *m)
 Temporarily unlock a locked mutex.
 
 ThreadReleaseLock::ThreadReleaseLock (ThreadLock &tl)
 Temporarily unlock a locked mutex.
 
 ThreadReleaseLock::ThreadReleaseLock (ThreadLock *tl)
 Temporarily unlock a locked mutex.
 
 ThreadReleaseLock::~ThreadReleaseLock ()
 Lock the temporarily unlock mutex.
 
 HttpCmdThreadPool::HttpCmdThreadPool (HttpServer *server, ThreadPriority priority, int stackSize)
 Create an instance of HttpCmdThreadPool and bind the thread pool to an instance of the HttpServer class. More...
 
 HttpCmdThreadPool::~HttpCmdThreadPool ()
 Terminates all threads in the thread pool and deregisters the thread pool in the HttpServer instance. More...
 

Typedef Documentation

◆ HttpCmdThreadPool

An instance of this class provides a thread pool to an instance of the HttpServer class.

An instance of this class creates N threads where N is identical to the value set with method HttpServerConfig::setNoOfHttpCommands.

See the Http Command Thread Pool documentation for more information.

Enumeration Type Documentation

◆ ThreadPriority

Thread priority list.

You can set 1 of 5 priorities: ThreadPrioLowest, ThreadPrioLow, ThreadPrioNormal, ThreadPrioHigh and ThreadPrioHighest

Function Documentation

◆ 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 class.

The constructor creates N threads, where N is set identical to the number of HttpCommand instances in the HttpServer object. See HttpServerConfig::setNoOfHttpCommands for more information.

Please note that failure to create the necessary resources is considered a fatal error.

Parameters
serveris the HttpServer instance you bind this object to.
priorityis the priority for the created thread(s).
stackSizeis the stack size for the created thread(s).

◆ ~HttpCmdThreadPool()

HttpCmdThreadPool::~HttpCmdThreadPool ( )

Terminates all threads in the thread pool and deregisters the thread pool in the HttpServer instance.

Make sure you run this destructor before you terminate the HttpServer instance. Please note that calling this destructor may take considerable time as the destructor must wait for all threads to complete.

The dispatcher must be locked prior to calling the destructor. See the Dispatcher Mutext for more information.