Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regex-morph.c: Add alloc_key() under #if HAVE_THREADS_H #1505

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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