projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
First snapshot of FIO for Windows
[fio.git]
/
mutex.c
diff --git
a/mutex.c
b/mutex.c
index abe073f4ffdf7d49ee92500db8d89e254def2852..c1ce2a3e8740de808e70076a141b642646f9087f 100644
(file)
--- a/
mutex.c
+++ b/
mutex.c
@@
-33,6
+33,14
@@
struct fio_mutex *fio_mutex_init(int value)
return NULL;
}
return NULL;
}
+#ifdef FIO_HAVE_FALLOCATE
+ ret = posix_fallocate(fd, 0, sizeof(struct fio_mutex));
+ if (ret > 0) {
+ fprintf(stderr, "posix_fallocate mutex failed: %s\n", strerror(ret));
+ goto err;
+ }
+#endif
+
if (ftruncate(fd, sizeof(struct fio_mutex)) < 0) {
perror("ftruncate mutex");
goto err;
if (ftruncate(fd, sizeof(struct fio_mutex)) < 0) {
perror("ftruncate mutex");
goto err;
@@
-85,6
+93,9
@@
struct fio_mutex *fio_mutex_init(int value)
goto err;
}
goto err;
}
+ pthread_condattr_destroy(&cond);
+ pthread_mutexattr_destroy(&attr);
+
return mutex;
err:
if (mutex)
return mutex;
err:
if (mutex)