Skip to content

Commit

Permalink
Merge pull request #1505 from ampli/no_thread_h
Browse files Browse the repository at this point in the history
regex-morph.c: Add alloc_key() under #if HAVE_THREADS_H
  • Loading branch information
linas authored Apr 24, 2024
2 parents 4102946 + c7bb48c commit 77254ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion link-grammar/dict-common/regex-morph.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ static void reg_free(Regex_node *rn)
#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);
if (thrd_success == rc) return;
prt_error("Error: pcre2 alloc per-thread key failed\n");
}
#endif // HAVE_THREADS_H && !__EMSCRIPTEN__

static pcre2_match_data* alloc_match_data(void)
{
Expand Down

0 comments on commit 77254ab

Please sign in to comment.