Acquire a lock for the file with the specified descriptor if it is currently available. If the specified lockWriteFlag is true, acquire an exclusive write lock unless another process has any type of lock on the file. If lockWriteFlag is false, acquire a shared read lock unless a process has a write lock. This method will not block. Return 0 on success, k_ERROR_LOCKING_CONFLICT if the platform reports the lock could not be acquired because another process holds a conflicting lock, and a negative value for any other kind of error. Note that this operation locks the indicated file for the current process, but the behavior is unspecified (and platform‐dependent) when either attempting to lock descriptor multiple times, or attempting to lock another descriptor referring to the same file, within a single process.
Synopsis
Declared in <bdls_filesystemutil.h>
static
int
tryLock(
FileDescriptor descriptor,
bool lockWriteFlag);
Created with MrDocs