Commit 6e4182f8 authored by Yoni Fogel's avatar Yoni Fogel

Fixed warnings in trylock.c

git-svn-id: file:///svn/tokudb@5850 c7de825b-a66e-492c-adef-691d508d4ae1
parent 29ac9b3c
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h>
float tdiff (struct timeval *start, struct timeval *end) { float tdiff (struct timeval *start, struct timeval *end) {
return 1e6*(end->tv_sec-start->tv_sec) +(end->tv_usec - start->tv_usec); return 1e6*(end->tv_sec-start->tv_sec) +(end->tv_usec - start->tv_usec);
...@@ -24,7 +25,7 @@ static void compResults(char *string, int rc) { ...@@ -24,7 +25,7 @@ static void compResults(char *string, int rc) {
pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER; pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER;
void *rdlockThread(void *arg) void *rdlockThread(void *arg __attribute__((unused)))
{ {
int rc; int rc;
int count=0; int count=0;
...@@ -58,13 +59,13 @@ void *rdlockThread(void *arg) ...@@ -58,13 +59,13 @@ void *rdlockThread(void *arg)
rc = pthread_rwlock_unlock(&rwlock); rc = pthread_rwlock_unlock(&rwlock);
gettimeofday(&end, 0); gettimeofday(&end, 0);
compResults("pthread_rwlock_unlock()\n", rc); compResults("pthread_rwlock_unlock()\n", rc);
printf("%d.%6d to %d.%6d is %9.2f\n", start.tv_sec, start.tv_usec, end.tv_sec, end.tv_usec, tdiff(&start, &end)); printf("%lu.%6lu to %lu.%6lu is %9.2f\n", start.tv_sec, start.tv_usec, end.tv_sec, end.tv_usec, tdiff(&start, &end));
printf("Secondary thread complete\n"); printf("Secondary thread complete\n");
return NULL; return NULL;
} }
int main(int argc, char **argv) int main(int argc __attribute__((unused)), char **argv)
{ {
int rc=0; int rc=0;
pthread_t thread; pthread_t thread;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment