IMultiMapTKey, TValueTryLock Method (TKey, Int64, TimeUnit)Hazelcast .Net Client Class Library
Tries to acquire the lock for the specified key.

Namespace: Hazelcast.Core
Assembly: Hazelcast.Net (in Hazelcast.Net.dll) Version: 3.6.4.0
Syntax

bool TryLock(
	TKey key,
	long time,
	TimeUnit timeunit
)

Parameters

key
Type: TKey
the key to lock
time
Type: SystemInt64
the maximum time to wait for the lock
timeunit
Type: Hazelcast.CoreTimeUnit
the time unit of the time argument.

Return Value

Type: Boolean
true if the lock was acquired and false if the waiting time elapsed before the lock was acquired.
Exceptions

ExceptionCondition
Exception
See Also

Reference