reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
platform.h File Reference

Platform API for runtime plugins to use while sharing implementation source code and binaries with the core and with each other. More...

Go to the source code of this file.

Typedefs

typedef void * lf_platform_mutex_ptr_t
 Pointer to the platform-specific implementation of a mutex.
 

Functions

lf_platform_mutex_ptr_t lf_platform_mutex_new ()
 Create a new mutex and return (a pointer to) it.
 
void lf_platform_mutex_free (lf_platform_mutex_ptr_t mutex)
 Free all resources associated with the provided mutex.
 
int lf_platform_mutex_lock (lf_platform_mutex_ptr_t mutex)
 Acquire the given mutex.
 
int lf_platform_mutex_unlock (lf_platform_mutex_ptr_t mutex)
 Release the given mutex.
 
int lf_thread_id ()
 The ID of the current thread. The only guarantee is that these IDs will be a contiguous range of numbers starting at 0.
 

Detailed Description

Platform API for runtime plugins to use while sharing implementation source code and binaries with the core and with each other.

Author
Peter Donovan (peter.nosp@m.@xro.nosp@m.nos.c.nosp@m.om)
Version
0.1
Date
2024-01-29

Typedef Documentation

◆ lf_platform_mutex_ptr_t

typedef void* lf_platform_mutex_ptr_t

Pointer to the platform-specific implementation of a mutex.

Function Documentation

◆ lf_platform_mutex_free()

void lf_platform_mutex_free ( lf_platform_mutex_ptr_t mutex)

Free all resources associated with the provided mutex.

◆ lf_platform_mutex_lock()

int lf_platform_mutex_lock ( lf_platform_mutex_ptr_t mutex)

Acquire the given mutex.

Returns
0 on success, platform-specific error number otherwise.

◆ lf_platform_mutex_new()

lf_platform_mutex_ptr_t lf_platform_mutex_new ( )

Create a new mutex and return (a pointer to) it.

◆ lf_platform_mutex_unlock()

int lf_platform_mutex_unlock ( lf_platform_mutex_ptr_t mutex)

Release the given mutex.

Returns
0 on success, platform-specific error number otherwise.

◆ lf_thread_id()

int lf_thread_id ( )

The ID of the current thread. The only guarantee is that these IDs will be a contiguous range of numbers starting at 0.

The ID of the current thread. The only guarantee is that these IDs will be a contiguous range of numbers starting at 0.