PDK API Guide for J721E
MutexP

Introduction

MutexP interface

Files

file  MutexP.h
 Mailbox module for the RTOS Porting Interface.
 

Data Structures

struct  MutexP_Object
 MutexP Mutex Object. More...
 

Functions

MutexP_Handle MutexP_create (MutexP_Object *mutexObj)
 Function to create a mutex. More...
 
MutexP_Status MutexP_delete (MutexP_Handle handle)
 Function to delete a mutex. More...
 
MutexP_Status MutexP_unlock (MutexP_Handle handle)
 Function to unlock the mutex. More...
 
MutexP_Status MutexP_lock (MutexP_Handle handle, uint32_t timeout)
 Function to lock the mutex. More...
 

Typedefs

typedef void * MutexP_Handle
 Opaque client reference to an instance of a MutexP. More...
 

Enumerations

enum  MutexP_Status { MutexP_OK = 0, MutexP_FAILURE = (-(int32_t)1), MutexP_TIMEOUT = (-(int32_t)2) }
 Status codes for MutexP APIs. More...
 

Macros

#define MutexP_WAIT_FOREVER   (~((uint32_t)0U))
 Wait forever define. More...
 
#define MutexP_NO_WAIT   ((uint32_t)0U)
 No wait define. More...
 

Macro Definition Documentation

◆ MutexP_WAIT_FOREVER

#define MutexP_WAIT_FOREVER   (~((uint32_t)0U))

Wait forever define.

◆ MutexP_NO_WAIT

#define MutexP_NO_WAIT   ((uint32_t)0U)

No wait define.

Typedef Documentation

◆ MutexP_Handle

typedef void* MutexP_Handle

Opaque client reference to an instance of a MutexP.

A MutexP_Handle returned from the MutexP_create represents that instance and is used in the other instance based functions

Enumeration Type Documentation

◆ MutexP_Status

Status codes for MutexP APIs.

Enumerator
MutexP_OK 

API completed successfully

MutexP_FAILURE 

API failed

MutexP_TIMEOUT 

API failed because of a timeout

Function Documentation

◆ MutexP_create()

MutexP_Handle MutexP_create ( MutexP_Object mutexObj)

Function to create a mutex.

Parameters
mutexObjPointer to the mutex object
Returns
A MutexP_Handle on success or a NULL on an error

◆ MutexP_delete()

MutexP_Status MutexP_delete ( MutexP_Handle  handle)

Function to delete a mutex.

Parameters
handleA MutexP_Handle returned from MutexP_create
Returns
Status of the functions
  • MutexP_OK: Deleted the mutex instance
  • MutexP_FAILURE: Failed to delete the mutex instance

◆ MutexP_unlock()

MutexP_Status MutexP_unlock ( MutexP_Handle  handle)

Function to unlock the mutex.

Parameters
handleA MutexP_Handle returned from MutexP_create
Returns
Status of the functions
  • MutexP_OK: Unlocked the mutex
  • MutexP_FAILURE: Failed to unlock the mutex

◆ MutexP_lock()

MutexP_Status MutexP_lock ( MutexP_Handle  handle,
uint32_t  timeout 
)

Function to lock the mutex.

Parameters
handleA MutexP_Handle returned from MutexP_create
timeoutTimeout (in milliseconds) to wait for lock the mutex.
Returns
Status of the functions
  • MutexP_OK: Locked the mutex
  • MutexP_TIMEOUT: Timed out waiting for a mutex unlock
  • MutexP_FAILURE: Failed to lock the mutex