Locking#

Functions#

OmniClientRequestId omniClientLock(char const *url, void *userData, OmniClientLockCallback callback)

Lock a file so no other clients can modify it.

OmniClientRequestId omniClientUnlock(char const *url, void *userData, OmniClientUnlockCallback callback)

Unlock a file so other clients can modify it.

Typedefs#

OmniClientLockCallback

This is called with the result of omniClientLock .

OmniClientUnlockCallback

This is called with the result of omniClientUnlock .

Functions#

OmniClientRequestId omniClientLock(
char const *url,
void *userData,
OmniClientLockCallback callback,
)#

Lock a file so no other clients can modify it.

The file is automatically unlocked when you disconnect

Note

If this function is called after omniClientShutdown, kInvalidRequestId will be returned, and the callback will not be called.

Parameters:
  • url – The URL of the file to lock

  • userData – User data passed to the callback

  • callback – The callback function to register

Returns:

A request ID that can be used with omniClientStop

OmniClientRequestId omniClientUnlock(
char const *url,
void *userData,
OmniClientUnlockCallback callback,
)#

Unlock a file so other clients can modify it.

Note

If this function is called after omniClientShutdown, kInvalidRequestId will be returned, and the callback will not be called.

Parameters:
  • url – The URL of the file to unlock

  • userData – User data passed to the callback

  • callback – The callback function to register

Returns:

A request ID that can be used with omniClientStop

Typedefs#

typedef void (*OmniClientLockCallback)(void *userData, OmniClientResult result)#

This is called with the result of omniClientLock.

typedef void (*OmniClientUnlockCallback)(void *userData, OmniClientResult result)#

This is called with the result of omniClientUnlock.