LibJuno 1.0.4
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
juno_thread_init.cpp File Reference
#include "juno/thread_api.h"
#include "juno/macros.h"
Include dependency graph for juno_thread_init.cpp:

Functions

JUNO_STATUS_T JunoThread_Init (JUNO_THREAD_ROOT_T *ptRoot, const JUNO_THREAD_API_T *ptApi, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, void *pvFailureUserData)
 Initialize a Thread module root instance.
 

Function Documentation

◆ JunoThread_Init()

JUNO_STATUS_T JunoThread_Init ( JUNO_THREAD_ROOT_T ptRoot,
const JUNO_THREAD_API_T ptApi,
JUNO_FAILURE_HANDLER_T  pfcnFailureHandler,
void *  pvFailureUserData 
)

Initialize a Thread module root instance.

Initialise a Thread module root with a concrete vtable and failure handler.

Wires the vtable pointer into the root, clears the cooperative stop flag, and stores the optional failure handler and its associated user-data pointer. This function must be called before any vtable dispatch function (Stop, Join, Free).

The OS thread handle is not initialised here; it is stored in the platform-specific derivation and set by JunoThread_LinuxInit after a successful pthread_create call.

Parameters
ptRootCaller-owned root storage. Must not be NULL.
ptApiVtable (e.g., &g_junoThreadLinuxApi or a test double). Must not be NULL.
pfcnFailureHandlerOptional diagnostic callback; may be NULL.
pvFailureUserDataOpaque user data passed to pfcnFailureHandler; may be NULL.
Returns
JUNO_STATUS_SUCCESS on success, JUNO_STATUS_NULLPTR_ERROR if ptRoot or ptApi is NULL.