Click or drag to resize

IMapTKey, TValueTryLock Method (TKey)

Tries to acquire the lock for the specified key.

Namespace:  Hazelcast.Core
Assembly:  Hazelcast.Net (in Hazelcast.Net.dll) Version: 3.9.3
Syntax
bool TryLock(
	TKey key
)

Parameters

key
Type: TKey
key to lock.

Return Value

Type: Boolean
true if lock is acquired, false otherwise.
Remarks
Tries to acquire the lock for the specified key.

If the lock is not available then the current thread doesn't wait and returns false immediately.

Warning:

This method uses GetHashCode and Equals of binary form of the key, not the actual implementations of GetHashCode and Equals defined in key's class.
See Also