diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-06-26 15:04:13 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-06-26 15:04:13 -0400 |
commit | 1313875b02c690ca5a40e585d24fdec240bb419d (patch) | |
tree | 6cd7733b8e3ae07129955fcb627f313032456f10 /src/xregex.c | |
parent | abd29143d805fa16c65489d5b1d79428943d0187 (diff) | |
download | bfs-1313875b02c690ca5a40e585d24fdec240bb419d.tar.xz |
thread: Wrap more pthread APIs
Diffstat (limited to 'src/xregex.c')
-rw-r--r-- | src/xregex.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/xregex.c b/src/xregex.c index 88df082..beb6676 100644 --- a/src/xregex.c +++ b/src/xregex.c @@ -5,6 +5,7 @@ #include "alloc.h" #include "config.h" #include "diag.h" +#include "thread.h" #include "sanity.h" #include <errno.h> #include <pthread.h> @@ -106,9 +107,7 @@ static void bfs_onig_once(void) { /** Initialize Oniguruma. */ static int bfs_onig_initialize(OnigEncoding *enc) { static pthread_once_t once = PTHREAD_ONCE_INIT; - if (pthread_once(&once, bfs_onig_once) != 0) { - return ONIGERR_FAIL_TO_INITIALIZE; - } + call_once(&once, bfs_onig_once); *enc = bfs_onig_enc; return bfs_onig_status; |