ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcbSchedThread.c File Reference

Macros

#define _GNU_SOURCE
 
#define _REENTRANT
 

Functions

int ngcbThrCreate (void *(*startFunc)(void *), void *arg, size_t stack, ngcb_thread_t *thread)
 
void ngcbThrExit (void *status)
 
int ngcbThrCancel (ngcb_thread_t thread)
 
int ngcbThrKill (ngcb_thread_t thread, int sig)
 
int ngcbThrJoin (ngcb_thread_t thread)
 
ngcb_thread_t ngcbThrId (void)
 
int ngcbThrEqual (ngcb_thread_t t1, ngcb_thread_t t2)
 

Detailed Description

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

◆ _REENTRANT

#define _REENTRANT

Function Documentation

◆ ngcbThrCancel()

int ngcbThrCancel ( ngcb_thread_t thread)

Cancel a thread defined by its thread-id.

◆ ngcbThrCreate()

int ngcbThrCreate ( void *(* startFunc )(void *),
void * arg,
size_t stack,
ngcb_thread_t * thread )

Create a new thread. The stack size is given in bytes. When the stack size is set to zero then the system default value (4M) is used.

◆ ngcbThrEqual()

int ngcbThrEqual ( ngcb_thread_t t1,
ngcb_thread_t t2 )

Test the equality of the two threads t1 and t2. The function returns non-zero if t1 and t2 refer to the same thread, otherwise zero.

◆ ngcbThrExit()

void ngcbThrExit ( void * status)

Function to be be called when exitig from a thread.

◆ ngcbThrId()

ngcb_thread_t ngcbThrId ( void )

Return the thread-id of the calling process.

◆ ngcbThrJoin()

int ngcbThrJoin ( ngcb_thread_t thread)

Waits until the thread given by its thread-id exits.

◆ ngcbThrKill()

int ngcbThrKill ( ngcb_thread_t thread,
int sig )

Send a signal to a thread defined by its thread-id.