iLLD_TC27xD  1.0
Synchronization Functions
Collaboration diagram for Synchronization Functions:

Functions

IFX_EXTERN boolean IfxCpu_acquireMutex (IfxCpu_mutexLock *lock)
 API to acquire the mutex (binary semaphore). More...
 
IFX_EXTERN void IfxCpu_releaseMutex (IfxCpu_mutexLock *lock)
 API to unlock the mutex . More...
 
IFX_EXTERN void IfxCpu_resetSpinLock (IfxCpu_spinLock *lock)
 API to unlock the resource . More...
 
IFX_EXTERN boolean IfxCpu_setSpinLock (IfxCpu_spinLock *lock, uint32 timeoutCount)
 API to lock the resource in spin mode with the given timeout. More...
 

Detailed Description

Function Documentation

IFX_EXTERN boolean IfxCpu_acquireMutex ( IfxCpu_mutexLock lock)

API to acquire the mutex (binary semaphore).

This API can be used to acquire/get the mutex.

Parameters
locklock pointer
Returns
TRUE : lock acquired successfully. FALSE: Failed to acquire the lock
IfxCpu_mutexLock resourceLock;
boolean flag = IfxCpu_acquireMutex(&resourceLock);
if (flag){
// critical section
IfxCpu_releaseMutex(&resourceLock);
}

Definition at line 36 of file IfxCpu.c.

IFX_EXTERN void IfxCpu_releaseMutex ( IfxCpu_mutexLock lock)

API to unlock the mutex .

This API can be used to unlock the previously acquired mutex

Parameters
locklock pointer
Returns
None
IfxCpu_mutexLock resourceLock;
boolean flag = IfxCpu_acquireMutex(&resourceLock);
if (flag){
// critical section
IfxCpu_releaseMutex(&resourceLock);
}

Definition at line 249 of file IfxCpu.c.

IFX_EXTERN void IfxCpu_resetSpinLock ( IfxCpu_spinLock lock)

API to unlock the resource .

This API can be used to unlock the previously acquired lock

Parameters
locklock pointer
Returns
None

Definition at line 256 of file IfxCpu.c.

IFX_EXTERN boolean IfxCpu_setSpinLock ( IfxCpu_spinLock lock,
uint32  timeoutCount 
)

API to lock the resource in spin mode with the given timeout.

This API can be used to spin lock for the lock for the given timeout period.

Parameters
locklock pointer
timeoutCountloop counter value used for timeout to acquire lock
Returns
TRUE : lock acquired successfully. FALSE: Failed to acquire the lock
IfxCpu_spinLock resourceLock;
boolean flag = IfxCpu_setSpinLock(&resourceLock, 0xFFFF);
if (flag){
// critical section
IfxCpu_resetSpinLock(&resourceLock);
}

Definition at line 421 of file IfxCpu.c.