Skip to content

Latest commit

 

History

History
69 lines (50 loc) · 2.17 KB

lock-h.md

File metadata and controls

69 lines (50 loc) · 2.17 KB
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

lock.h

A minimalistic platform agnostic lock abstraction for thread synchronization.

Includes

#include "azure_macro_utils/macro_utils.h"
#include "umock_c/umock_c_prod.h"

Detailed Description

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.

Functions

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.

Macro definitions

LOCK_RESULT_VALUES

#define LOCK_RESULT_VALUES \
        LOCK_OK, \
        LOCK_ERROR 

Enumeration types

LOCK_RESULT

Enumeration specifying the lock status.

enum LOCK_RESULT {
  LOCK_RESULT_INVALID,
  LOCK_OK,
  LOCK_ERROR
}

Type definitions

LOCK_HANDLE

typedef void* LOCK_HANDLE;