mirror of
https://github.com/fuse-friends/fuse-native
synced 2024-10-27 18:34:01 +00:00
Use abstr_thread_t instead of thread_t for thread typedef
This commit is contained in:
parent
b8a3e44d47
commit
13fc745c1f
@ -7,13 +7,13 @@
|
||||
|
||||
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
void thread_create (thread_t* thread, thread_fn fn, void* data) {
|
||||
void thread_create (abstr_thread_t* thread, thread_fn fn, void* data) {
|
||||
pthread_attr_t attr;
|
||||
pthread_attr_init(&attr);
|
||||
pthread_create(thread, &attr, fn, data);
|
||||
}
|
||||
|
||||
void thread_join (thread_t thread) {
|
||||
void thread_join (abstr_thread_t thread) {
|
||||
pthread_join(thread, NULL);
|
||||
}
|
||||
|
||||
@ -61,13 +61,13 @@ void fusermount (char *path) {
|
||||
|
||||
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
void thread_create (thread_t* thread, thread_fn fn, void* data) {
|
||||
void thread_create (abstr_thread_t* thread, thread_fn fn, void* data) {
|
||||
pthread_attr_t attr;
|
||||
pthread_attr_init(&attr);
|
||||
pthread_create(thread, &attr, fn, data);
|
||||
}
|
||||
|
||||
void thread_join (thread_t thread) {
|
||||
void thread_join (abstr_thread_t thread) {
|
||||
pthread_join(thread, NULL);
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ NAN_INLINE static void mutex_unlock (pthread_mutex_t *mutex) {
|
||||
pthread_mutex_unlock(mutex);
|
||||
}
|
||||
|
||||
typedef pthread_t thread_t;
|
||||
typedef pthread_t abstr_thread_t;
|
||||
typedef void* thread_fn_rtn_t;
|
||||
|
||||
#elif defined(_WIN32)
|
||||
@ -71,7 +71,7 @@ NAN_INLINE static void mutex_unlock (HANDLE *mutex) {
|
||||
ReleaseMutex(*mutex);
|
||||
}
|
||||
|
||||
typedef HANDLE thread_t;
|
||||
typedef HANDLE abstr_thread_t;
|
||||
typedef DWORD thread_fn_rtn_t;
|
||||
|
||||
#define fuse_session_remove_chan(x)
|
||||
@ -111,14 +111,14 @@ NAN_INLINE static void mutex_unlock (pthread_mutex_t *mutex) {
|
||||
pthread_mutex_unlock(mutex);
|
||||
}
|
||||
|
||||
typedef pthread_t thread_t;
|
||||
typedef pthread_t abstr_thread_t;
|
||||
typedef void* thread_fn_rtn_t;
|
||||
|
||||
#endif
|
||||
|
||||
typedef thread_fn_rtn_t(*thread_fn)(void*);
|
||||
|
||||
void thread_create (thread_t*, thread_fn, void*);
|
||||
void thread_join (thread_t);
|
||||
void thread_create (abstr_thread_t*, thread_fn, void*);
|
||||
void thread_join (abstr_thread_t);
|
||||
|
||||
void fusermount (char*);
|
||||
|
@ -67,7 +67,7 @@ struct bindings_t {
|
||||
// fuse data
|
||||
char mnt[1024];
|
||||
char mntopts[1024];
|
||||
thread_t thread;
|
||||
abstr_thread_t thread;
|
||||
bindings_sem_t semaphore;
|
||||
uv_async_t async;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user