lib60870-C  2.3.2
C source code library for the IEC 60870-5-101/104 protocols
Typedefs | Functions
Threading and synchronization API
Collaboration diagram for Threading and synchronization API:

Typedefs

typedef struct sThread * Thread
 
typedef void * Semaphore
 
typedef void *(* ThreadExecutionFunction) (void *)
 

Functions

PAL_API Thread Thread_create (ThreadExecutionFunction function, void *parameter, bool autodestroy)
 Create a new Thread instance. More...
 
PAL_API void Thread_start (Thread thread)
 Start a Thread. More...
 
PAL_API void Thread_destroy (Thread thread)
 Destroy a Thread and free all related resources. More...
 
PAL_API void Thread_sleep (int millies)
 Suspend execution of the Thread for the specified number of milliseconds.
 
PAL_API Semaphore Semaphore_create (int initialValue)
 
PAL_API void Semaphore_wait (Semaphore self)
 
PAL_API void Semaphore_post (Semaphore self)
 
PAL_API void Semaphore_destroy (Semaphore self)
 

Detailed Description

Typedef Documentation

◆ Semaphore

typedef void* Semaphore

Qpaque reference of a Semaphore instance

◆ Thread

typedef struct sThread* Thread

Opaque reference of a Thread instance

◆ ThreadExecutionFunction

typedef void*(* ThreadExecutionFunction) (void *)

Reference to a function that is called when starting the thread

Function Documentation

◆ Thread_create()

PAL_API Thread Thread_create ( ThreadExecutionFunction  function,
void *  parameter,
bool  autodestroy 
)

Create a new Thread instance.

Parameters
functionthe entry point of the thread
parametera parameter that is passed to the threads start function
autodestroythe thread is automatically destroyed if the ThreadExecutionFunction has finished.
Returns
the newly created Thread instance

◆ Thread_destroy()

PAL_API void Thread_destroy ( Thread  thread)

Destroy a Thread and free all related resources.

Parameters
threadthe Thread instance to destroy

◆ Thread_start()

PAL_API void Thread_start ( Thread  thread)

Start a Thread.

This function invokes the start function of the thread. The thread terminates when the start function returns.

Parameters
threadthe Thread instance to start