1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-27 21:01:50 +03:00

Reformat all code to coding standard

This commit is contained in:
Andrew Hutchings
2017-10-26 17:18:17 +01:00
parent 4985f3456e
commit 01446d1e22
1296 changed files with 403852 additions and 353747 deletions

View File

@ -28,39 +28,41 @@
using namespace std;
using namespace rwlock;
char *name;
char* name;
void usage()
{
cout << "Usage " << name << " which_lock_to_use which_side_to_use lock_or_unlock\n" <<
" which_lock_to_use: 1=VSS 2=ExtentMap 3=FreeList 4=VBBM 5=CopyLocks\n";
exit(1);
cout << "Usage " << name << " which_lock_to_use which_side_to_use lock_or_unlock\n" <<
" which_lock_to_use: 1=VSS 2=ExtentMap 3=FreeList 4=VBBM 5=CopyLocks\n";
exit(1);
}
int main(int argc, char **argv)
int main(int argc, char** argv)
{
uint32_t which_lock; // 1-5
RWLock *rwlock;
LockState state;
uint32_t which_lock; // 1-5
RWLock* rwlock;
LockState state;
name = argv[0];
name = argv[0];
if (argc != 2)
usage();
if (strlen(argv[1]) != 1)
usage();
if (argc != 2)
usage();
which_lock = atoi(argv[1]);
if (which_lock < 1 || which_lock > 5)
usage();
if (strlen(argv[1]) != 1)
usage();
rwlock = new RWLock(0x10000 * which_lock);
state = rwlock->getLockState();
cout << "readers = " << state.reading << endl
<< "writers = " << state.writing << endl
<< "readers waiting = " << state.readerswaiting << endl
<< "writers waiting = " << state.writerswaiting << endl
<< "mutex locked = " << (int) state.mutexLocked << endl;
which_lock = atoi(argv[1]);
return 0;
if (which_lock < 1 || which_lock > 5)
usage();
rwlock = new RWLock(0x10000 * which_lock);
state = rwlock->getLockState();
cout << "readers = " << state.reading << endl
<< "writers = " << state.writing << endl
<< "readers waiting = " << state.readerswaiting << endl
<< "writers waiting = " << state.writerswaiting << endl
<< "mutex locked = " << (int) state.mutexLocked << endl;
return 0;
}