aboutsummaryrefslogblamecommitdiffstats
path: root/yt/cpp/mapreduce/client/lock.h
blob: 7e2c7a127d4e419c5a4bf67188a53266b1c75e16 (plain) (tree)





























                                                                                  
#pragma once

#include "client.h"

#include <yt/cpp/mapreduce/interface/client.h>

namespace NYT {
namespace NDetail {

////////////////////////////////////////////////////////////////////////////////

class TLock
    : public ILock
{
public:
    TLock(const TLockId& lockId, TClientPtr client, bool waitable);

    virtual const TLockId& GetId() const override;
    virtual TNodeId GetLockedNodeId() const override;
    virtual const ::NThreading::TFuture<void>& GetAcquiredFuture() const override;

private:
    const TLockId LockId_;
    mutable TMaybe<::NThreading::TFuture<void>> Acquired_;
    TClientPtr Client_;
};

////////////////////////////////////////////////////////////////////////////////

} // namespace NDetail
} // namespace NYT