Search in sources :

Example 1 with BeforeAwaitOperation

use of com.hazelcast.concurrent.lock.operations.BeforeAwaitOperation in project hazelcast by hazelcast.

the class ConditionBeforeAwaitMessageTask method prepareOperation.

@Override
protected Operation prepareOperation() {
    final Data key = serializationService.toData(parameters.lockName);
    final InternalLockNamespace namespace = new InternalLockNamespace(parameters.lockName);
    return new BeforeAwaitOperation(namespace, key, parameters.threadId, parameters.name, parameters.referenceId);
}
Also used : InternalLockNamespace(com.hazelcast.concurrent.lock.InternalLockNamespace) BeforeAwaitOperation(com.hazelcast.concurrent.lock.operations.BeforeAwaitOperation) Data(com.hazelcast.nio.serialization.Data)

Example 2 with BeforeAwaitOperation

use of com.hazelcast.concurrent.lock.operations.BeforeAwaitOperation in project hazelcast by hazelcast.

the class ConditionImpl method beforeAwait.

private void beforeAwait(long threadId) {
    Data key = lockProxy.getKeyData();
    BeforeAwaitOperation op = new BeforeAwaitOperation(namespace, key, threadId, conditionId);
    InternalCompletableFuture f = invoke(op);
    f.join();
}
Also used : InternalCompletableFuture(com.hazelcast.spi.InternalCompletableFuture) BeforeAwaitOperation(com.hazelcast.concurrent.lock.operations.BeforeAwaitOperation) Data(com.hazelcast.nio.serialization.Data)

Aggregations

BeforeAwaitOperation (com.hazelcast.concurrent.lock.operations.BeforeAwaitOperation)2 Data (com.hazelcast.nio.serialization.Data)2 InternalLockNamespace (com.hazelcast.concurrent.lock.InternalLockNamespace)1 InternalCompletableFuture (com.hazelcast.spi.InternalCompletableFuture)1