Better code (preparation) [#CLICKHOUSE-3]

This commit is contained in:
Alexey Milovidov 2018-06-04 18:44:29 +03:00
parent d811647668
commit 5fa1cdf49e

View File

@ -21,18 +21,13 @@ using RWLockFIFOPtr = std::shared_ptr<RWLockFIFO>;
class RWLockFIFO : public std::enable_shared_from_this<RWLockFIFO>
{
public:
static RWLockFIFOPtr create()
{
return RWLockFIFOPtr(new RWLockFIFO);
}
enum Type
{
Read,
Write
};
private:
/// Client is that who wants to acquire the lock.
struct Client
{
@ -48,6 +43,12 @@ public:
Type type;
};
public:
static RWLockFIFOPtr create()
{
return RWLockFIFOPtr(new RWLockFIFO);
}
/// Just use LockHandler::reset() to release the lock
class LockHandlerImpl;
@ -69,7 +70,6 @@ public:
Clients getClientsInTheQueue() const;
private:
RWLockFIFO() = default;
struct Group;