All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.thehilikus.jrobocom.timing.BlockedEntry Maven / Gradle / Ivy

There is a newer version: 1.0.0-beta-02
Show newest version
package com.github.thehilikus.jrobocom.timing;

import java.util.concurrent.Semaphore;

/**
 * A waiting entity
 * 
 * @author hilikus
 */
final class BlockedEntry {

    private long timeout;

    Semaphore sync = new Semaphore(0);

    /**
     * Constructs a waiting entity
     * 
     * @param pTimeout the cycle where the entity unblocks
     */
    public BlockedEntry(long pTimeout) {
	timeout = pTimeout;
    }

    /**
     * @return the synchronization element
     */
    public Semaphore getSync() {
	return sync;
    }

    /**
     * @return the cycle where the entity unblocks
     */
    public long getTimeout() {
	return timeout;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy