title | titleSuffix | description | manager | author | ms.author | ms.date | ms.service | ms.custom | ms.topic |
---|---|---|---|---|---|---|---|---|---|
lock.h header file reference | Microsoft Docs |
Azure IoT C SDK |
This is the header file reference page for lock.h in the Azure IoT C SDK. This SDK is used with Azure IoT Hub and Azure IoT Hub Device Provisioning Service |
timlt |
wesmc7777 |
wesmc |
03/25/2022 |
iot-hub |
reference |
A minimalistic platform agnostic lock abstraction for thread synchronization.
#include "azure_macro_utils/macro_utils.h"
#include "umock_c/umock_c_prod.h"
The Lock component is implemented in order to achieve thread synchronization, as we may have a requirement to consume locks across different platforms. This component exposes some generic APIs so that it can be extended for platform specific implementations.
Function Name | Description |
---|---|
LOCK_RESULTStrings | |
LOCK_RESULT_FromString | |
Lock_Init | This API creates and returns a valid lock handle. |
Lock | Acquires a lock on the given lock handle. Uses platform specific mutex primitives in its implementation. |
Unlock | Releases the lock on the given lock handle. Uses platform specific mutex primitives in its implementation. |
Lock_Deinit | The lock instance is destroyed. |
#define LOCK_RESULT_VALUES \
LOCK_OK, \
LOCK_ERROR
Enumeration specifying the lock status.
enum LOCK_RESULT {
LOCK_RESULT_INVALID,
LOCK_OK,
LOCK_ERROR
}
typedef void* LOCK_HANDLE;