aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/util/syncable.h
blob: 8dd75216259a89af2b643dd94ed2cd67b6a9c406 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

namespace vespalib {

/**
 * An syncable is an interface that waits for something to complete.
 **/
class Syncable
{
public:
    /**
     * Synchronize with this executor. This function will block until
     * all previously accepted tasks have been executed. This function
     * uses the event barrier algorithm (tm).
     *
     * @return this object; for chaining
     **/
    virtual Syncable &sync() = 0;

    virtual ~Syncable() {}
};

} // namespace vespalib