mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-17 17:55:12 +00:00
Merge pull request #309 from ggtakec/master
Check pthread prtability in configure as additional change for #307
This commit is contained in:
commit
87d04acb2f
23
configure.ac
23
configure.ac
@ -228,6 +228,29 @@ dnl ----------------------------------------------
|
||||
dnl malloc_trim function
|
||||
AC_CHECK_FUNCS([malloc_trim])
|
||||
|
||||
dnl ----------------------------------------------
|
||||
dnl check symbols/macros/enums
|
||||
dnl ----------------------------------------------
|
||||
dnl PTHREAD_MUTEX_RECURSIVE
|
||||
AC_MSG_CHECKING([pthread mutex recursive])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <pthread.h>]],
|
||||
[[int i = PTHREAD_MUTEX_RECURSIVE;]])
|
||||
],
|
||||
[AC_DEFINE(S3FS_MUTEX_RECURSIVE, PTHREAD_MUTEX_RECURSIVE, [Define if you have PTHREAD_MUTEX_RECURSIVE])
|
||||
AC_MSG_RESULT(PTHREAD_MUTEX_RECURSIVE)
|
||||
],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <pthread.h>]],
|
||||
[[int i = PTHREAD_MUTEX_RECURSIVE_NP;]])
|
||||
],
|
||||
[AC_DEFINE(S3FS_MUTEX_RECURSIVE, PTHREAD_MUTEX_RECURSIVE_NP, [Define if you have PTHREAD_MUTEX_RECURSIVE_NP])
|
||||
AC_MSG_RESULT(PTHREAD_MUTEX_RECURSIVE_NP)
|
||||
],
|
||||
[AC_MSG_ERROR([do not have PTHREAD_MUTEX_RECURSIVE symbol])])
|
||||
]
|
||||
)
|
||||
|
||||
dnl ----------------------------------------------
|
||||
dnl output files
|
||||
dnl ----------------------------------------------
|
||||
|
@ -619,7 +619,7 @@ FdEntity::FdEntity(const char* tpath, const char* cpath)
|
||||
try{
|
||||
pthread_mutexattr_t attr;
|
||||
pthread_mutexattr_init(&attr);
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); // recursive mutex
|
||||
pthread_mutexattr_settype(&attr, S3FS_MUTEX_RECURSIVE); // recursive mutex
|
||||
pthread_mutex_init(&fdent_lock, &attr);
|
||||
is_lock_init = true;
|
||||
}catch(exception& e){
|
||||
|
Loading…
Reference in New Issue
Block a user