Skip to content

Commit d22d740

Browse files
committed
build fixes
1 parent 16715c4 commit d22d740

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

libusb/hid.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static int pthread_barrier_wait(pthread_barrier_t *barrier)
148148

149149
#define THREAD_STATE_WAIT_TIMED_OUT ETIMEDOUT
150150

151-
typdef struct
151+
typedef struct
152152
{
153153
pthread_t thread;
154154
pthread_mutex_t mutex; /* Protects input_reports */
@@ -171,15 +171,8 @@ static void thread_state_free(hid_device_thread_state *state)
171171
pthread_mutex_destroy(&state->mutex);
172172
}
173173

174-
static void thread_state_push_cleanup(void (*routine)(void *), void *arg)
175-
{
176-
pthread_cleanup_push(&cleanup_mutex, dev);
177-
}
178-
179-
static void thread_state_pop_cleanup(int execute)
180-
{
181-
pthread_cleanup_pop(execute);
182-
}
174+
#define thread_state_push_cleanup pthread_cleanup_push
175+
#define thread_state_pop_cleanup pthread_cleanup_pop
183176

184177
static void thread_state_lock(hid_device_thread_state *state)
185178
{
@@ -218,7 +211,7 @@ static void thread_state_wait_barrier(hid_device_thread_state *state)
218211

219212
static void thread_state_create_thread(hid_device_thread_state *state, void *(*func)(void*), void *func_arg)
220213
{
221-
pthread_create(&dev->thread, NULL, func, param);
214+
pthread_create(&state->thread, NULL, func, func_arg);
222215
}
223216

224217
static void thread_state_join_thread(hid_device_thread_state *state)

0 commit comments

Comments
 (0)