1
0
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:
Leonid Fedorov
2022-01-21 16:43:49 +00:00
parent 6b6411229f
commit 04752ec546
1376 changed files with 393460 additions and 412662 deletions

View File

@@ -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