Skip to content

Commit

Permalink
Use correct define and fix types in threadwrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Jovasa committed Jul 30, 2024
1 parent 1eeccb3 commit a7aeb23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/threadqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ threadqueue_queue_t * kvz_threadqueue_init(int thread_count)
threadqueue->first = NULL;
threadqueue->last = NULL;

#ifndef _WIN32
#ifndef _MSC_VER
pthread_attr_t attr;
if (pthread_attr_init(&attr) != 0) {
fprintf(stderr, "pthread_attr_init failed!\n");
Expand All @@ -407,7 +407,7 @@ threadqueue_queue_t * kvz_threadqueue_init(int thread_count)
}
}
#else
pthread_attr_t* attr;
pthread_attr_t attr;
#endif

// Lock the queue before creating threads, to ensure they all have correct information.
Expand All @@ -425,7 +425,7 @@ threadqueue_queue_t * kvz_threadqueue_init(int thread_count)
return threadqueue;

failed:
#ifndef _WIN32
#ifndef _MSC_VER
if (pthread_attr_destroy(&attr) != 0) {
fprintf(stderr, "pthread_attr_destroy failed!\n");
}
Expand Down
8 changes: 4 additions & 4 deletions src/threadwrapper/include/pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ typedef void* pthread_rwlock_t;
typedef void* pthread_t;
typedef void*(voidp_voidp_func)(void*);

typedef void pthread_attr_t;
typedef void pthread_condattr_t;
typedef void pthread_mutexattr_t;
typedef void pthread_rwlockattr_t;
typedef void* pthread_attr_t;
typedef void* pthread_condattr_t;
typedef void* pthread_mutexattr_t;
typedef void* pthread_rwlockattr_t;

// Parameter names that have been commented away do nothing,
// as they are always null when the functions are used in Kvazaar.
Expand Down

0 comments on commit a7aeb23

Please sign in to comment.