| 3270 | } |
| 3271 | |
| 3272 | XN_C_API XnStatus xnLockNodeForChanges(XnNodeHandle hInstance, XnLockHandle* phLock) |
| 3273 | { |
| 3274 | XnStatus nRetVal = XN_STATUS_OK; |
| 3275 | |
| 3276 | XN_VALIDATE_INPUT_PTR(hInstance); |
| 3277 | |
| 3278 | if (hInstance->LockData.nCurrentLock != 0) |
| 3279 | { |
| 3280 | return (XN_STATUS_NODE_IS_LOCKED); |
| 3281 | } |
| 3282 | |
| 3283 | // lock it |
| 3284 | if (xnIsCapabilitySupported(hInstance, XN_CAPABILITY_LOCK_AWARE)) |
| 3285 | { |
| 3286 | nRetVal = xnSetLockStateImpl(hInstance, TRUE); |
| 3287 | XN_IS_STATUS_OK(nRetVal); |
| 3288 | } |
| 3289 | |
| 3290 | // give it a unique lock handle |
| 3291 | XnUInt32 nLockID = ++hInstance->pContext->nLastLockID; |
| 3292 | |
| 3293 | hInstance->LockData.nCurrentLock = nLockID; |
| 3294 | |
| 3295 | // return to user |
| 3296 | *phLock = nLockID; |
| 3297 | |
| 3298 | return (XN_STATUS_OK); |
| 3299 | } |
| 3300 | |
| 3301 | XN_C_API XnStatus xnUnlockNodeForChanges(XnNodeHandle hInstance, XnLockHandle hLock) |
| 3302 | { |
no test coverage detected