Software Library API naibrd 1.62
See all documentation at naii.docs.com
Board Control Mutex Functions

Functions

NAIBRDFUNC nai_status_t NAIAPI naibrd_Lock (int32_t cardIndex)
 Locks the board, preventing other threads from communicating with the board until naibrd_Release is called. Every call to naibrd_Lock MUST have a matching call to naibrd_Release. Boards can be locked recursively.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_Release (int32_t cardIndex)
 Unlocks the board, allowing other threads/tasks to communicate with the board. The thread/task that last locked the board must call this. If the board is locked N times by the same thread/task, the board will only be unlocked after the Nth call to naibrd_Release by that thread/task.
 

Detailed Description


Function Documentation

◆ naibrd_Lock()

NAIBRDFUNC nai_status_t NAIAPI naibrd_Lock ( int32_t cardIndex)

Locks the board, preventing other threads from communicating with the board until naibrd_Release is called. Every call to naibrd_Lock MUST have a matching call to naibrd_Release. Boards can be locked recursively.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_LOCK_FAILED when the thread/task is unable to lock the card within NAI_MUTEX_TIMEOUT milliseconds.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_Release()

NAIBRDFUNC nai_status_t NAIAPI naibrd_Release ( int32_t cardIndex)

Unlocks the board, allowing other threads/tasks to communicate with the board. The thread/task that last locked the board must call this. If the board is locked N times by the same thread/task, the board will only be unlocked after the Nth call to naibrd_Release by that thread/task.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.