Skip to content

Commit

Permalink
use valid address in pthread_setspecific to silence warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
qmuntal committed Sep 4, 2024
1 parent 2ae7b98 commit 186768a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion thread_setup_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ static pthread_mutex_t *mutex_buf = NULL;

static pthread_key_t destructor_key;

static char dummy;

/* Used by unit tests. */
volatile unsigned int go_openssl_threads_cleaned_up = 0;

Expand All @@ -29,7 +31,7 @@ static void thread_id(GO_CRYPTO_THREADID_PTR tid)
// least once on any thread with associated error state. The thread-local
// variable needs to be set to a non-NULL value so that the destructor will
// be called when the thread exits. The actual value does not matter.
(void) pthread_setspecific(destructor_key, (void*)1);
(void) pthread_setspecific(destructor_key, &dummy);
}

static void cleanup_thread_state(void *ignored)
Expand Down

0 comments on commit 186768a

Please sign in to comment.