Search in sources :

Example 1 with AsyncStoppable

use of org.gradle.internal.concurrent.AsyncStoppable in project gradle by gradle.

the class DefaultWorkerProcess method onConnect.

public void onConnect(ObjectConnection connection, Runnable connectionHandler) {
    AsyncStoppable stoppable;
    lock.lock();
    try {
        LOGGER.debug("Received connection {} from {}", connection, execHandle);
        if (connectionHandler != null && running) {
            connectionHandler.run();
        }
        this.connection = connection;
        if (aborted) {
            connection.abort();
        }
        condition.signalAll();
        stoppable = acceptor;
    } finally {
        lock.unlock();
    }
    if (stoppable != null) {
        stoppable.requestStop();
    }
}
Also used : AsyncStoppable(org.gradle.internal.concurrent.AsyncStoppable)

Aggregations

AsyncStoppable (org.gradle.internal.concurrent.AsyncStoppable)1