NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release

Detailed Description

Typedefs

typedef struct NvOsMutexRec * NvOsMutexHandle
 

Functions

NvError NvOsMutexCreate (NvOsMutexHandle *mutex)
 This function creates a mutex. More...
 
NvError NvOsMutexDestroyEx (NvOsMutexHandle mutex)
 This function destroys a mutex. More...
 
NvError NvOsMutexLockEx (NvOsMutexHandle mutex)
 This function locks a mutex. More...
 
NvError NvOsMutexUnlockEx (NvOsMutexHandle mutex)
 This function unlocks a mutex. More...
 

Typedef Documentation

◆ NvOsMutexHandle

typedef struct NvOsMutexRec* NvOsMutexHandle

Handle for NvOS mutex. This is an opaque type and should not be dereferenced.

Definition at line 344 of file nvos_s3_tegra_safety.h.

Function Documentation

◆ NvOsMutexCreate()

NvError NvOsMutexCreate ( NvOsMutexHandle *  mutex)

This function creates a mutex.

  • If one mutex handle is given to this function, multiple times
    • Previously initialized mutex handle is leaked,
    • Mutex handle is initialized, newly
Parameters
[out]mutexCreated mutex handle
Returns
NvSuccess Success
NvError_BadParameter if mutex is NULL (errno is set with EINVAL)
NvError_InsufficientMemory Error if memory allocation for mutex handle, is failed
NvError_ResourceError Error if pthread_mutex_init() return error
Precondition
None
Note
This function does not include a check for API mode as a simple wrapper of the underlying QNX_System libc_api. It is the responsibility of the caller to ensure that this API is invoked in the appropriate VM state, as described in the "API group" section below.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: No
  • Maturity: GA

◆ NvOsMutexDestroyEx()

NvError NvOsMutexDestroyEx ( NvOsMutexHandle  mutex)

This function destroys a mutex.

Parameters
[in]mutexMutex handle to be destroyed
Returns
NvSuccess Success
NvError_BadParameter Error when mutex handle is NULL or mutex is invalid.
NvError_Busy Error when the mutex is locked by another thread.
Precondition
NvOsMutexCreate() must be called to get the mutex handle before calling this function.
Note
This function does not include a check for API mode as a simple wrapper of the underlying QNX_System libc_api. It is the responsibility of the caller to ensure that this API is invoked in the appropriate VM state, as described in the "API group" section below.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required Privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: No
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsMutexLockEx()

NvError NvOsMutexLockEx ( NvOsMutexHandle  mutex)

This function locks a mutex.

  • If mutex handle is locked already
    • then, the calling thread is blocked until mutex handle is unlocked
  • Otherwise, mutex handle is locked, and this function return
Parameters
[in]mutexMutex handle to be locked
Returns
NvSuccess Success
NvError_BadParameter Error when mutex handle is NULL or mutex is invalid.
NvError_Busy Error when the maximum number of recursive locks for mutex has been exceeded.
NvError_InvalidState Error when dealock condition is detected or the user of mutex is terminated while holding the mutex lock.
NvError_Timeout Error when QNX kernel timeout unblocks the call to this API or the calling thread was unblocked by a call to QNX API pthread_mutex_wakup_np().
Precondition
NvOsMutexCreate() must be called to get the mutex handle before calling this function.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required Privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsMutexUnlockEx()

NvError NvOsMutexUnlockEx ( NvOsMutexHandle  mutex)

This function unlocks a mutex.

Parameters
[in]mutexMutex handle to be unlocked
Returns
NvSuccess : Success
NvError_AccessDenied Error when the calling thread does not own the mutex.
NvError_BadParameter Error when mutex handle is NULL or mutex is invalid.
Precondition
NvOsMutexCreate() must be called to get the mutex handle before calling this function.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required Privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA