Skip to content

Commit

Permalink
Merge pull request opencog#1504 from ryandesign/once_flag
Browse files Browse the repository at this point in the history
Only use once_flag/tss_t vars if we have threads.h
  • Loading branch information
linas authored Apr 23, 2024
2 parents 77dda9c + 94eed5c commit 55c72e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions link-grammar/dict-common/regex-morph.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,11 @@ static void reg_free(Regex_node *rn)
/* ========================================================================= */
#if HAVE_PCRE2_H

#if HAVE_THREADS_H && !__EMSCRIPTEN__
static once_flag call_once_flag = ONCE_FLAG_INIT;
static tss_t re_md_key;
#endif // HAVE_THREADS_H && !__EMSCRIPTEN__

static void alloc_key(void)
{
int rc = tss_create(&re_md_key, (tss_dtor_t) pcre2_match_data_free);
Expand Down

0 comments on commit 55c72e2

Please sign in to comment.