nn::os::Mutex::TryLock Member Function

Syntax

#include <nn/os.h>

bool TryLock(
     nn::fnd::TimeSpan timeout = 0
);

Arguments

Name Description
in timeout Specifies the timeout period. Specifying 0 will cause control to return immediately.

Return Values

Returns whether the lock succeeded.

Description

Tries to lock a mutex.

Tries to lock a mutex and returns true if successful. If it could not lock the mutex, this function waits for at most the length of time specified by timeout and returns true if it gets a lock by then. Returns false if it cannot get a lock even after waiting for the time specified by timeout.

Revision History

2010/01/07
Initial version.

CONFIDENTIAL