You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
clang format apply
This commit is contained in:
@@ -21,32 +21,31 @@
|
||||
/* Quicky impl of a read-write lock that prioritizes writers. */
|
||||
namespace storagemanager
|
||||
{
|
||||
class RWLock
|
||||
{
|
||||
public:
|
||||
RWLock();
|
||||
~RWLock();
|
||||
|
||||
void readLock();
|
||||
// this version will release the lock in the parameter after locking this instance
|
||||
void readLock(boost::unique_lock<boost::mutex> &);
|
||||
void readUnlock();
|
||||
void writeLock();
|
||||
// this version will release the lock in the parameter after locking this instance
|
||||
void writeLock(boost::unique_lock<boost::mutex> &);
|
||||
void writeUnlock();
|
||||
|
||||
// returns true if anything is blocked on or owns this lock instance.
|
||||
bool inUse();
|
||||
|
||||
private:
|
||||
uint readersWaiting;
|
||||
uint readersRunning;
|
||||
uint writersWaiting;
|
||||
uint writersRunning;
|
||||
boost::mutex m;
|
||||
boost::condition okToWrite;
|
||||
boost::condition okToRead;
|
||||
};
|
||||
}
|
||||
class RWLock
|
||||
{
|
||||
public:
|
||||
RWLock();
|
||||
~RWLock();
|
||||
|
||||
void readLock();
|
||||
// this version will release the lock in the parameter after locking this instance
|
||||
void readLock(boost::unique_lock<boost::mutex>&);
|
||||
void readUnlock();
|
||||
void writeLock();
|
||||
// this version will release the lock in the parameter after locking this instance
|
||||
void writeLock(boost::unique_lock<boost::mutex>&);
|
||||
void writeUnlock();
|
||||
|
||||
// returns true if anything is blocked on or owns this lock instance.
|
||||
bool inUse();
|
||||
|
||||
private:
|
||||
uint readersWaiting;
|
||||
uint readersRunning;
|
||||
uint writersWaiting;
|
||||
uint writersRunning;
|
||||
boost::mutex m;
|
||||
boost::condition okToWrite;
|
||||
boost::condition okToRead;
|
||||
};
|
||||
} // namespace storagemanager
|
||||
|
Reference in New Issue
Block a user