X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/f0dcb6b97d6d40f67698d1f71ac26970f1776f82..ebd5aef6dc92accb509b1cc67eaf72159f35cdfa:/lock_tester.cc?ds=inline diff --git a/lock_tester.cc b/lock_tester.cc index f535d8f..5e615ca 100644 --- a/lock_tester.cc +++ b/lock_tester.cc @@ -22,7 +22,7 @@ static lock_protocol::lockid_t c = "3"; static int ct[256]; static mutex count_mutex; -void check_grant(lock_protocol::lockid_t lid) { +static void check_grant(lock_protocol::lockid_t lid) { lock ml(count_mutex); int x = lid[0] & 0x0f; if (ct[x] != 0) { @@ -32,7 +32,7 @@ void check_grant(lock_protocol::lockid_t lid) { ct[x] += 1; } -void check_release(lock_protocol::lockid_t lid) { +static void check_release(lock_protocol::lockid_t lid) { lock ml(count_mutex); int x = lid[0] & 0x0f; if (ct[x] != 1) { @@ -42,7 +42,7 @@ void check_release(lock_protocol::lockid_t lid) { ct[x] -= 1; } -void test1(void) { +static void test1(void) { LOG_NONMEMBER("acquire a release a acquire a release a"); lc[0]->acquire(a); check_grant(a); @@ -64,7 +64,7 @@ void test1(void) { check_release(a); } -void test2(int i) { +static void test2(int i) { LOG_NONMEMBER("test2: client " << i << " acquire a release a"); lc[i]->acquire(a); LOG_NONMEMBER("test2: client " << i << " acquire done"); @@ -76,7 +76,7 @@ void test2(int i) { LOG_NONMEMBER("test2: client " << i << " release done"); } -void test3(int i) { +static void test3(int i) { LOG_NONMEMBER("test3: client " << i << " acquire a release a concurrent"); for (int j = 0; j < 10; j++) { lc[i]->acquire(a); @@ -87,7 +87,7 @@ void test3(int i) { } } -void test4(int i) { +static void test4(int i) { LOG_NONMEMBER("test4: thread " << i << " acquire a release a concurrent; same clnt"); for (int j = 0; j < 10; j++) { lc[0]->acquire(a); @@ -98,7 +98,7 @@ void test4(int i) { } } -void test5(int i) { +static void test5(int i) { LOG_NONMEMBER("test5: client " << i << " acquire a release a concurrent; same and diff clnt"); for (int j = 0; j < 10; j++) { if (i < 5) lc[0]->acquire(a);