mars/mars_mutex.h File Reference

[host] MARS Mutex API More...


Functions

int mars_mutex_initialize (struct mars_mutex *mutex)
 [host] Initializes a mutex.
int mars_mutex_lock (struct mars_mutex *mutex)
 [host] Locks a mutex.
int mars_mutex_unlock (struct mars_mutex *mutex)
 [host] Unlocks a mutex.


Detailed Description

[host] MARS Mutex API


Function Documentation

int mars_mutex_initialize ( struct mars_mutex mutex  ) 

[host] Initializes a mutex.

This function initializes a mutex instance that can be locked or unlocked from both host and MPU to restrict concurrent accesses.

Parameters:
[in] mutex - pointer to mutex instance to initialize
Returns:
MARS_SUCCESS - successfully initialized mutex
MARS_ERROR_NULL - null pointer is specified
MARS_ERROR_ALIGN - instance not aligned properly

int mars_mutex_lock ( struct mars_mutex mutex  ) 

[host] Locks a mutex.

This function locks a mutex and blocks other requests to lock it.

Parameters:
[in] mutex - pointer to mutex instance to lock
Returns:
MARS_SUCCESS - successfully locked mutex
MARS_ERROR_NULL - null pointer is specified
MARS_ERROR_ALIGN - instance not aligned properly

int mars_mutex_unlock ( struct mars_mutex mutex  ) 

[host] Unlocks a mutex.

This function unlocks a previously locked mutex to allow other lock requests.

Parameters:
[in] mutex - pointer to mutex instance to unlock
Returns:
MARS_SUCCESS - successfully unlocked mutex
MARS_ERROR_NULL - null pointer is specified
MARS_ERROR_ALIGN - instance not aligned properly
MARS_ERROR_STATE - instance not in locked state


Generated on Wed Jun 25 11:07:27 2008 for MARS by  doxygen 1.5.2