threadgroup Class Reference

Array group of threads. More...

#include <thread.h>

Collaboration diagram for threadgroup:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void add (class groupthread *t)
void remove (class groupthread *t)
groupthreadoperator[] (int idx)
void broadcastevent (const value &ev)
void broadcastevent (const string &tp)
void broadcastevent (const statstring &tp)
void broadcastevent (const char *tp)
void broadcastevent (const statstring &t, const value &ev)
int count (void)
void gc (void)

Public Attributes

lock< int > lck

Protected Attributes

class groupthread ** array
int cnt
int arraysz

Detailed Description

Array group of threads.

Storage for situations where you have a group of worker threads that you want to keep track of. Collects thread objects that are derived from the groupthread class.


Member Function Documentation

void threadgroup::add ( class groupthread t  ) 

Add a new thread to the array.

Called from the groupthread constructor.

References arraysz, cnt, lck, lockbase::lockw(), and lockbase::unlock().

Referenced by groupthread::groupthread().

Here is the call graph for this function:

void threadgroup::broadcastevent ( const value ev  ) 

Send an event to all member threads.

Starts with the last thread in the array

Parameters:
ev The event data.

References cnt, and gc().

Here is the call graph for this function:

int threadgroup::count ( void   )  [inline]

Get a thread count.

Returns:
Number of threads in the array.

References cnt.

Referenced by httpd::handle(), smtpd::run(), httpd::run(), and smtpd::shutdown().

groupthread& threadgroup::operator[] ( int  idx  )  [inline]

Array access operator.

Parameters:
idx The index number.
Returns:
Reference to object at index.
Exceptions:
threadGroupIndexException Index was out of bounds.

References cnt.


The documentation for this class was generated from the following files:

Generated on Sun Feb 28 10:36:58 2010 for GRACE by  doxygen 1.6.1