Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Nov 4, 2021
1 parent 843fd15 commit 122a479
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/tbox/platform/posix/thread_local.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,12 @@ tb_bool_t tb_thread_local_set(tb_thread_local_ref_t local, tb_cpointer_t priv)
tb_bool_t ok = pthread_setspecific(((pthread_key_t*)local->priv)[0], priv) == 0;
if (ok)
{
// mark exists
ok = pthread_setspecific(((pthread_key_t*)local->priv)[1], (tb_pointer_t)tb_true) == 0;
/* mark exists and we use dummy variable to silence glibc 2.34 warnings
* https://github.com/SELinuxProject/selinux/issues/311
*/
tb_int_t dummy;
ok = pthread_setspecific(((pthread_key_t*)local->priv)[1], &dummy) == 0;
}

// ok?
return ok;
}

0 comments on commit 122a479

Please sign in to comment.