aboutsummaryrefslogtreecommitdiffstats
path: root/jrt/src/com/yahoo/jrt/SingleRequestWaiter.java
blob: 089d9352752ac99e551e04d5d6ec24ecd565797c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jrt;


class SingleRequestWaiter implements RequestWaiter {

    private boolean done = false;

    public synchronized void handleRequestDone(Request req) {
        done = true;
        notify();
    }

    public synchronized void waitDone() {
        while (!done) {
            try { wait(); } catch (InterruptedException e) {}
        }
    }
}