# OS_GetLockID

## Syntax

      #include <nitro/os.h>

      s32 OS_GetLockID( void );

## Arguments

None.

## Return Values

This is an unused ID. It produces an error for `OS_LOCK_ID_ERROR`. The ID itself is `u16` data, but because of the error detection, the return value has `s32` format.

## Description

Obtains an unused ID The ID is obtained using this function so that IDs will not overlap with the `OS_Lock*` function.

If there are unused IDs, one can be obtained in the 0x40 to 0x6F range (ARM9 environment) or in the 0x80 to 0xAF range (ARM7 environment). For any processor, when an ID cannot be obtained (conceivably because there are no openings), `OS_LOCK_ID_ERROR` is returned. Note also that this value is a negative number.

If an ID is not needed, release it using `OS_ReleaseLockID()`. If all IDs are already assigned, `OS_GetLockID()` will not return an ID value until one is released.

## See Also

`OS_ReleaseLockID
`

## Revision History

2008/11/06 Corrected range of available values for ARM9.
2004/07/22 Added mention that ID is u16.
2004/06/21 Initial version.

CONFIDENTIAL