NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release

Detailed Description

Typedefs

typedef struct NvOsConditionRec * NvOsConditionHandle
 

Functions

NvError NvOsConditionBroadcast (NvOsConditionHandle cond)
 This function resumes multiple threads which wait the condition. More...
 
NvError NvOsConditionCreate (NvOsConditionHandle *cond)
 This function creates a condition. More...
 
NvError NvOsConditionDestroy (NvOsConditionHandle cond)
 This function destroys a condition. More...
 
NvError NvOsConditionSignal (NvOsConditionHandle cond)
 This function resumes a thread which wait the condition. More...
 
NvError NvOsConditionWait (NvOsConditionHandle cond, NvOsMutexHandle mutex)
 This function waits a condition. More...
 
NvError NvOsConditionWaitTimeout (NvOsConditionHandle cond, NvOsMutexHandle mutex, NvU32 microsecs)
 This function waits for a condition till timeout. More...
 

Typedef Documentation

◆ NvOsConditionHandle

typedef struct NvOsConditionRec* NvOsConditionHandle

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

Definition at line 39 of file nvos_s3_tegra_safety.h.

Function Documentation

◆ NvOsConditionBroadcast()

NvError NvOsConditionBroadcast ( NvOsConditionHandle  cond)

This function resumes multiple threads which wait the condition.

Parameters
[in]condThe condition handle to wait on
Returns
NvSuccess Success
NvError_BadParameter Error if cond parameter is null
NvError_BadParameter Error if pthread_cond_broadcast() return error
Precondition
NvOsConditionCreate() must be called to get the condition handle before calling this function


Usage considerations

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

◆ NvOsConditionCreate()

NvError NvOsConditionCreate ( NvOsConditionHandle *  cond)

This function creates a condition.

Parameters
[out]condThe condition handle is created
Returns
NvSuccess Success
NvError_BadParameter if cond is NULL
NvError_InsufficientMemory Error if memory allocation for creating condition, is failed
NvError_Busy Error if pthread_cond_init() return error
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.
Precondition
None


Usage considerations

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

◆ NvOsConditionDestroy()

NvError NvOsConditionDestroy ( NvOsConditionHandle  cond)

This function destroys a condition.

Parameters
[in]condCondition handle to be destroyed
Returns
NvSuccess Success
NvError_BadParameter Error if cond parameter is null
NvError_Busy Error if pthread_cond_destroy() return error as the condition is being used
NvError_Busy Error if pthread_cond_destroy() return error
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.
Precondition
NvOsConditionCreate() must be called to get the condition handle before calling this function


Usage considerations

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

◆ NvOsConditionSignal()

NvError NvOsConditionSignal ( NvOsConditionHandle  cond)

This function resumes a thread which wait the condition.

  • If multiple threads are waiting,
    • The highest priority thread is resumed
  • If multiple threads are waiting, and they are same priority,
    • The thread (which has been waiting the longest) is resumed
Parameters
[in]condCondition handle to wait
Returns
NvSuccess Success
NvError_BadParameter Error if cond is null
NvError_BadParameter Error if pthread_cond_signal() return error
Precondition
NvOsConditionCreate() must be called to get the condition handle before calling this function


Usage considerations

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

◆ NvOsConditionWait()

NvError NvOsConditionWait ( NvOsConditionHandle  cond,
NvOsMutexHandle  mutex 
)

This function waits a condition.

Parameters
[in]condCondition handle to wait
[in]mutexThe mutex handle, which will be unlocked when cond parameter is signaled
Returns
NvSuccess Success
NvError_BadParameter Error if cond parameter is invalid
NvError_BadParameter Error if mutex parameter is invalid
NvError_BadParameter Error if pthread_cond_signal() return error
Precondition
NvOsConditionCreate() must be called to get the condition handle before calling this function and 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: Yes
    • Re-entrant: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsConditionWaitTimeout()

NvError NvOsConditionWaitTimeout ( NvOsConditionHandle  cond,
NvOsMutexHandle  mutex,
NvU32  microsecs 
)

This function waits for a condition till timeout.

Parameters
[in]condCondition handle to wait on
[in]mutexThe mutex handle, which will be unlocked when cond parameter is signaled
[in]microsecsTimeout in microsec
Returns
NvSuccess Success
NvError_BadParameter Error if cond or mutex parameter is NULL
NvError_BadParameter Error if other error that is not permission error or timeout error
NvError_BadParameter Error if clock_gettime() returns -1
NvError_AccessDenied Error if a calling thread is not the owner of a mutex
NvError_AccessDenied Error if a mutex is already locked by the owner
NvError_Timeout Error if a thread doesn't get a signal within timeout of microsec
Precondition
NvOsConditionCreate() must be called to get the condition handle before calling this function and 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: Yes
    • Re-entrant: No
    • Thread-safe: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA