mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Better code (preparation) [#CLICKHOUSE-3]
This commit is contained in:
parent
d811647668
commit
5fa1cdf49e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user