public class BlocksLocker extends Object
Constructor and Description |
---|
BlocksLocker(WorkerStorage workerStorage,
int userId) |
Modifier and Type | Method and Description |
---|---|
int |
lock(long blockId)
Lock a block.
|
boolean |
locked(long blockId)
Check if the block is locked in the local memory
|
void |
unlock(long blockId,
int lockId)
Unlock a block with a lock id.
|
public BlocksLocker(WorkerStorage workerStorage, int userId)
public int lock(long blockId)
blockId
- The id of the block.public boolean locked(long blockId)
blockId
- The id of the blockpublic void unlock(long blockId, int lockId)
blockId
- The id of the block.lockId
- The lock id of the lock.Copyright © 2014. All rights reserved.