13#error This is a C++ include file and cannot be used from plain C
27#include <sys/socket.h>
74 explicit ngcbSEM(
unsigned int count);
77 ngcbSEM(
unsigned int count,
int check);
83 int Create(
ngcbSEM_T *sp,
unsigned int count,
int check,
char *erms = NULL);
131 int Set(
unsigned int cnt);
200 void *arg,
size_t stack = 0);
204 ngcbTHREAD_T *threadId,
size_t stack,
char *erms = NULL);
213 int ThrKill(
int sig,
char *erms = NULL);
219 int ThrJoin(
char *erms = NULL);
289 ngcbTIMER(
int after,
int periodic,
int ms,
int id);
ngcbPTIMER(int ms, int id)
Constructor with timer value and id.
Definition ngcbTHREAD.hpp:334
ngcbPTIMER(int after, int ms, int id)
Constructor with start delay (milliseconds), timer value and id.
Definition ngcbTHREAD.hpp:337
ngcbPTIMER(int ms)
Constructor with timer value (milliseconds)
Definition ngcbTHREAD.hpp:331
virtual ~ngcbPTIMER()
Destructor.
Definition ngcbTHREAD.hpp:340
ngcbSEMC(unsigned int count)
Constructor.
Definition ngcbTHREAD.hpp:162
virtual ~ngcbSEMC()
Destructor.
Definition ngcbTHREAD.hpp:165
int Lock()
Lock this semaphore.
Definition ngcbSEM.cpp:332
int Destroy(ngcbSEM_T *sp, char *erms=NULL)
Destroy a semaphore.
Definition ngcbSEM.cpp:134
int TryWait()
Try to wait for this semaphore.
Definition ngcbSEM.cpp:423
int Wait()
Wait for this semaphore.
Definition ngcbSEM.cpp:410
ngcbSEM()
Constructor.
Definition ngcbSEM.cpp:27
int TryLock()
Try to lock this semaphore.
Definition ngcbSEM.cpp:358
int Set(ngcbSEM_T *sp, unsigned int cnt)
Set semaphore counter.
Definition ngcbSEM.cpp:230
size_t Cnt()
Get actual value of this semaphore counter.
Definition ngcbSEM.cpp:436
virtual ~ngcbSEM()
Destructor.
Definition ngcbSEM.cpp:54
size_t WaitCnt(ngcbSEM_T *sp, size_t cnt)
Wait until counter is reached exactly or becomes zereo.
Definition ngcbSEM.cpp:248
int Unlock()
Unlock this semaphore.
Definition ngcbSEM.cpp:345
int Create(ngcbSEM_T *sp, unsigned int count, int check, char *erms=NULL)
Create a semaphore of given type (error checking on or off)
Definition ngcbSEM.cpp:72
int Post()
Post this semaphore.
Definition ngcbSEM.cpp:371
Definition ngcbTHREAD.hpp:186
int FdOut()
Return file descrioptor to wakeup a thread.
Definition ngcbTHREAD.cpp:314
ngcbTHREAD()
Normal constructor.
Definition ngcbTHREAD.cpp:53
void ThrExit()
Thread exit.
Definition ngcbTHREAD.cpp:213
virtual ~ngcbTHREAD()
Destructor.
Definition ngcbTHREAD.cpp:129
int ThrJoin(ngcbTHREAD_T threadId, char *erms=NULL)
Wait for a thread.
Definition ngcbTHREAD.cpp:260
ngcbTHREAD_T ThreadId()
Get own thread-Id.
Definition ngcbTHREAD.cpp:310
int ThrEqual(ngcbTHREAD_T t1, ngcbTHREAD_T t2)
Test the equality of the two threads t1 and t2.
Definition ngcbTHREAD.cpp:305
int ThrKill(ngcbTHREAD_T threadId, int sig, char *erms=NULL)
Cancel thread by thread-id.
Definition ngcbTHREAD.cpp:222
int FdIn()
Return file descriptor to be used by the thread for wakeup call.
Definition ngcbTHREAD.cpp:316
void * ExecProc()
Entry point for c-linkage thread.
Definition ngcbTHREAD.cpp:318
int Initialized()
Return flag for successful initialization.
Definition ngcbTHREAD.cpp:312
int ThrCreate(ngcbTHREAD *app, ngcbPROCESS_T process, void *arg, ngcbTHREAD_T *threadId, size_t stack, char *erms=NULL)
Thread creation.
Definition ngcbTHREAD.cpp:176
virtual ngcbTHREAD * NewThread(ngcbTHREAD *app, ngcbPROCESS_T process, void *arg, size_t stack=0)
Process to be overloaded.
Definition ngcbTHREAD.cpp:169
int Fd()
Return timer file descriptor for select call.
Definition ngcbTIMER.cpp:87
ngcbTIMER & operator=(const ngcbTIMER &other)
Operator =.
Definition ngcbTIMER.cpp:28
virtual ~ngcbTIMER()
Destructor.
Definition ngcbTIMER.cpp:82
ngcbTIMER(const ngcbTIMER &other)
Copy constructor.
Definition ngcbTIMER.cpp:41
int RecvId()
Receive timer id.
Definition ngcbTIMER.cpp:182
void(ngcbTHREAD::* ngcbPROCESS_T)(ngcbTHREAD *thread, void *arg)
Definition ngcbTHREAD.hpp:181
int ngcbInSignalHandler
Definition ngcbTHREAD.cpp:26
pthread_t ngcbTHREAD_T
Definition ngcbTHREAD.hpp:58
void * ngcbTHREAD_ExecProc(void *arg)
Definition ngcbTHREAD.cpp:31
Definition ngcbTHREAD.hpp:44
pthread_mutex_t mutex_v
Protection mutex.
Definition ngcbTHREAD.hpp:46
pthread_cond_t lck
Condition variable.
Definition ngcbTHREAD.hpp:49
size_t val
Semaphore counter value.
Definition ngcbTHREAD.hpp:52