gettime-thread: fix missing startup mutex
authorJens Axboe <axboe@fb.com>
Wed, 17 Dec 2014 02:49:54 +0000 (19:49 -0700)
committerJens Axboe <axboe@fb.com>
Wed, 17 Dec 2014 02:49:54 +0000 (19:49 -0700)
It'll segfault if gtod_cpu= is used, ensure we pass in the mutex.

Signed-off-by: Jens Axboe <axboe@fb.com>
gettime-thread.c

index 72cc4d8a472783f7e73d7d40f8a8da9f56759a2a..95f35c32e46cff25f6b43005462f608e1975fabf 100644 (file)
@@ -63,7 +63,7 @@ int fio_start_gtod_thread(void)
 
        pthread_attr_init(&attr);
        pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN);
 
        pthread_attr_init(&attr);
        pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN);
-       ret = pthread_create(&gtod_thread, &attr, gtod_thread_main, NULL);
+       ret = pthread_create(&gtod_thread, &attr, gtod_thread_main, mutex);
        pthread_attr_destroy(&attr);
        if (ret) {
                log_err("Can't create gtod thread: %s\n", strerror(ret));
        pthread_attr_destroy(&attr);
        if (ret) {
                log_err("Can't create gtod thread: %s\n", strerror(ret));