IoT managed integrations End Device SDK
Loading...
Searching...
No Matches
iotmi_pal_Thread.h
Go to the documentation of this file.
1/*
2 * Copyright 2025 Amazon.com, Inc. or its affiliates. All rights reserved.
3 *
4 * AMAZON PROPRIETARY/CONFIDENTIAL
5 *
6 * You may not use this file except in compliance with the terms and
7 * conditions set forth in the accompanying LICENSE.txt file.
8 *
9 * THESE MATERIALS ARE PROVIDED ON AN "AS IS" BASIS. AMAZON SPECIFICALLY
10 * DISCLAIMS, WITH RESPECT TO THESE MATERIALS, ALL WARRANTIES, EXPRESS,
11 * IMPLIED, OR STATUTORY, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
12 * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
13 */
14
20#ifndef IOTMI_PAL_THREAD_H_
21#define IOTMI_PAL_THREAD_H_
22
23#include <stdint.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
32struct iotmiPal_ThreadStruct;
33typedef struct iotmiPal_ThreadStruct iotmiPal_ThreadStruct_t;
34typedef struct iotmiPal_ThreadStruct* iotmiPal_ThreadHandle_t;
35
42typedef void (*iotmiPal_ThreadFunction_t)(void* pParam);
43
47typedef enum iotmiPal_ThreadType {
48 /* Generic thread type. */
49 IOTMI_PAL_THREAD_URGENT = 0,
50 IOTMI_PAL_THREAD_NORMAL,
51 IOTMI_PAL_THREAD_BACKGROUND,
52
53 /* SDK specific thread type. */
54 IOTMI_PAL_THREAD_MQTT_AGENT,
55 IOTMI_PAL_THREAD_DATA_MODEL_HANDLER,
56 IOTMI_PAL_THREAD_JOB_HANDLER,
57
58 IOTMI_PAL_THREAD_MISC
60
61/*-----------------------------------------------------------*/
62
76iotmiPal_ThreadHandle_t iotmiPal_threadCreate(
77 const char* pThreadname, iotmiPal_ThreadType_t threadType,
78 iotmiPal_ThreadFunction_t threadFunc, void* pParam);
79
88int iotmiPal_threadJoin(iotmiPal_ThreadHandle_t threadHandle);
89
95void iotmiPal_threadSleepMs(uint32_t sleepTimeMs);
96
97#ifdef __cplusplus
98}
99#endif
100
101#endif /* ifndef IOTMI_PAL_THREAD_H_ */
void(* iotmiPal_ThreadFunction_t)(void *pParam)
Thread function to be executed in the created thread.
Definition iotmi_pal_Thread.h:42
enum iotmiPal_ThreadType iotmiPal_ThreadType_t
Thread type to be created.
void iotmiPal_threadSleepMs(uint32_t sleepTimeMs)
Millisecond sleep function.
int iotmiPal_threadJoin(iotmiPal_ThreadHandle_t threadHandle)
Thread join function.
iotmiPal_ThreadHandle_t iotmiPal_threadCreate(const char *pThreadname, iotmiPal_ThreadType_t threadType, iotmiPal_ThreadFunction_t threadFunc, void *pParam)
Create thread function.
iotmiPal_ThreadType
Thread type to be created.
Definition iotmi_pal_Thread.h:47