diff options
Diffstat (limited to 'storage/tokudb/PerconaFT/util/tests/test-rwlock.cc')
-rw-r--r-- | storage/tokudb/PerconaFT/util/tests/test-rwlock.cc | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/storage/tokudb/PerconaFT/util/tests/test-rwlock.cc b/storage/tokudb/PerconaFT/util/tests/test-rwlock.cc index 18ca1229f56..56dd3f6b480 100644 --- a/storage/tokudb/PerconaFT/util/tests/test-rwlock.cc +++ b/storage/tokudb/PerconaFT/util/tests/test-rwlock.cc @@ -245,14 +245,14 @@ static void util_rwlock_unlock (RWLOCK rwlock, toku_mutex_t *mutex) { } // Time the read lock that's in util/rwlock.h -void time_util_rwlock (void) __attribute((__noinline__)); -void time_util_rwlock (void) { - struct rwlock rwlock; +void time_util_rwlock(void) __attribute((__noinline__)); +void time_util_rwlock(void) { + struct st_rwlock rwlock; toku_mutex_t external_mutex; - toku_mutex_init(&external_mutex, NULL); - rwlock_init(&rwlock); - struct timeval start,end; - + toku_mutex_init(toku_uninstrumented, &external_mutex, nullptr); + rwlock_init(toku_uninstrumented, &rwlock); + struct timeval start, end; + util_rwlock_lock(&rwlock, &external_mutex); util_rwlock_unlock(&rwlock, &external_mutex); for (int t=0; t<T; t++) { @@ -271,16 +271,17 @@ void time_util_rwlock (void) { toku_mutex_destroy(&external_mutex); } -// Time the read lock that's in util/rwlock.h, assuming the mutex is already held. -void time_util_prelocked_rwlock (void) __attribute__((__noinline__)); -void time_util_prelocked_rwlock (void) { - struct rwlock rwlock; +// Time the read lock that's in util/rwlock.h, assuming the mutex is already +// held. +void time_util_prelocked_rwlock(void) __attribute__((__noinline__)); +void time_util_prelocked_rwlock(void) { + struct st_rwlock rwlock; toku_mutex_t external_mutex; - toku_mutex_init(&external_mutex, NULL); + toku_mutex_init(toku_uninstrumented, &external_mutex, nullptr); toku_mutex_lock(&external_mutex); - rwlock_init(&rwlock); - struct timeval start,end; - + rwlock_init(toku_uninstrumented, &rwlock); + struct timeval start, end; + rwlock_read_lock(&rwlock, &external_mutex); rwlock_read_unlock(&rwlock); for (int t=0; t<T; t++) { @@ -303,8 +304,8 @@ void time_util_prelocked_rwlock (void) { void time_frwlock_prelocked(void) __attribute__((__noinline__)); void time_frwlock_prelocked(void) { toku_mutex_t external_mutex; - toku_mutex_init(&external_mutex, NULL); - struct timeval start,end; + toku_mutex_init(toku_uninstrumented, &external_mutex, nullptr); + struct timeval start, end; toku::frwlock x; x.init(&external_mutex); toku_mutex_lock(&external_mutex); @@ -340,8 +341,8 @@ void time_frwlock_prelocked(void) { void time_frwlock(void) __attribute__((__noinline__)); void time_frwlock(void) { toku_mutex_t external_mutex; - toku_mutex_init(&external_mutex, NULL); - struct timeval start,end; + toku_mutex_init(toku_uninstrumented, &external_mutex, nullptr); + struct timeval start, end; toku::frwlock x; x.init(&external_mutex); toku_mutex_lock(&external_mutex); |