summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-08-15 15:45:14 -0600
committerKarl Williamson <khw@cpan.org>2019-02-14 22:12:44 -0700
commit8310e7fa48c5bce320e9c36df267f587d84cebce (patch)
treea2fff54f43d31d9f3c3675ebd390ac666cb08c4a
parent3c5142a9e5aa4720092b95914808c82b46ca78b2 (diff)
downloadperl-8310e7fa48c5bce320e9c36df267f587d84cebce.tar.gz
Add mutex for dealing with qr/\p{user-defined}/
This will be used in future commits
-rw-r--r--dosish.h2
-rw-r--r--embedvar.h2
-rw-r--r--makedef.pl1
-rw-r--r--perl.c1
-rw-r--r--perl.h8
-rw-r--r--perlapi.h2
-rw-r--r--perlvars.h4
-rw-r--r--unixish.h4
8 files changed, 21 insertions, 3 deletions
diff --git a/dosish.h b/dosish.h
index 16ee9b7359..dff759b309 100644
--- a/dosish.h
+++ b/dosish.h
@@ -51,7 +51,7 @@
# define PERL_SYS_TERM_BODY() \
HINTS_REFCNT_TERM; KEYWORD_PLUGIN_MUTEX_TERM; \
OP_CHECK_MUTEX_TERM; OP_REFCNT_TERM; PERLIO_TERM; \
- MALLOC_TERM; LOCALE_TERM;
+ MALLOC_TERM; LOCALE_TERM; USER_PROP_MUTEX_TERM;
#endif
#define dXSUB_SYS dNOOP
diff --git a/embedvar.h b/embedvar.h
index 787d046a34..79f5bd04d3 100644
--- a/embedvar.h
+++ b/embedvar.h
@@ -468,6 +468,8 @@
#define PL_Gtimesbase (my_vars->Gtimesbase)
#define PL_use_safe_putenv (my_vars->Guse_safe_putenv)
#define PL_Guse_safe_putenv (my_vars->Guse_safe_putenv)
+#define PL_user_prop_mutex (my_vars->Guser_prop_mutex)
+#define PL_Guser_prop_mutex (my_vars->Guser_prop_mutex)
#define PL_utf8_charname_begin (my_vars->Gutf8_charname_begin)
#define PL_Gutf8_charname_begin (my_vars->Gutf8_charname_begin)
#define PL_utf8_charname_continue (my_vars->Gutf8_charname_continue)
diff --git a/makedef.pl b/makedef.pl
index e5ee6b9085..7e22e02a59 100644
--- a/makedef.pl
+++ b/makedef.pl
@@ -352,6 +352,7 @@ if ($define{'PERL_USE_SAFE_PUTENV'}) {
unless ($define{'USE_ITHREADS'}) {
++$skip{PL_thr_key};
+ ++$skip{PL_user_prop_mutex};
}
# USE_5005THREADS symbols. Kept as reference for easier removal
diff --git a/perl.c b/perl.c
index d82e1e720a..3c49f9650f 100644
--- a/perl.c
+++ b/perl.c
@@ -95,6 +95,7 @@ S_init_tls_and_interp(PerlInterpreter *my_perl)
KEYWORD_PLUGIN_MUTEX_INIT;
HINTS_REFCNT_INIT;
LOCALE_INIT;
+ USER_PROP_MUTEX_INIT;
MUTEX_INIT(&PL_dollarzero_mutex);
MUTEX_INIT(&PL_my_ctx_mutex);
# endif
diff --git a/perl.h b/perl.h
index dd66b120af..757fc7083c 100644
--- a/perl.h
+++ b/perl.h
@@ -5991,11 +5991,19 @@ typedef struct am_table_short AMTS;
# define KEYWORD_PLUGIN_MUTEX_LOCK MUTEX_LOCK(&PL_keyword_plugin_mutex)
# define KEYWORD_PLUGIN_MUTEX_UNLOCK MUTEX_UNLOCK(&PL_keyword_plugin_mutex)
# define KEYWORD_PLUGIN_MUTEX_TERM MUTEX_DESTROY(&PL_keyword_plugin_mutex)
+# define USER_PROP_MUTEX_INIT MUTEX_INIT(&PL_user_prop_mutex)
+# define USER_PROP_MUTEX_LOCK MUTEX_LOCK(&PL_user_prop_mutex)
+# define USER_PROP_MUTEX_UNLOCK MUTEX_UNLOCK(&PL_user_prop_mutex)
+# define USER_PROP_MUTEX_TERM MUTEX_DESTROY(&PL_user_prop_mutex)
#else
# define KEYWORD_PLUGIN_MUTEX_INIT NOOP
# define KEYWORD_PLUGIN_MUTEX_LOCK NOOP
# define KEYWORD_PLUGIN_MUTEX_UNLOCK NOOP
# define KEYWORD_PLUGIN_MUTEX_TERM NOOP
+# define USER_PROP_MUTEX_INIT NOOP
+# define USER_PROP_MUTEX_LOCK NOOP
+# define USER_PROP_MUTEX_UNLOCK NOOP
+# define USER_PROP_MUTEX_TERM NOOP
#endif
#ifdef USE_LOCALE /* These locale things are all subject to change */
diff --git a/perlapi.h b/perlapi.h
index de4267aa75..6d8ebf8b24 100644
--- a/perlapi.h
+++ b/perlapi.h
@@ -215,6 +215,8 @@ END_EXTERN_C
#define PL_timesbase (*Perl_Gtimesbase_ptr(NULL))
#undef PL_use_safe_putenv
#define PL_use_safe_putenv (*Perl_Guse_safe_putenv_ptr(NULL))
+#undef PL_user_prop_mutex
+#define PL_user_prop_mutex (*Perl_Guser_prop_mutex_ptr(NULL))
#undef PL_utf8_charname_begin
#define PL_utf8_charname_begin (*Perl_Gutf8_charname_begin_ptr(NULL))
#undef PL_utf8_charname_continue
diff --git a/perlvars.h b/perlvars.h
index 8a4ff6a47b..331105e841 100644
--- a/perlvars.h
+++ b/perlvars.h
@@ -307,6 +307,10 @@ PERLVAR(G, utf8_mark, SV *)
PERLVAR(G, InBitmap, SV *)
PERLVAR(G, CCC_non0_non230, SV *)
+#if defined(USE_ITHREADS)
+PERLVAR(G, user_prop_mutex, perl_mutex)
+#endif
+
/* Everything that folds to a given character, for case insensitivity regex
* matching */
PERLVAR(G, utf8_foldclosures, SV *)
diff --git a/unixish.h b/unixish.h
index cd869cd240..697a242243 100644
--- a/unixish.h
+++ b/unixish.h
@@ -141,7 +141,7 @@ int afstat(int fd, struct stat *statb);
# define PERL_SYS_TERM_BODY() \
HINTS_REFCNT_TERM; KEYWORD_PLUGIN_MUTEX_TERM; \
OP_CHECK_MUTEX_TERM; OP_REFCNT_TERM; PERLIO_TERM; \
- MALLOC_TERM; LOCALE_TERM; \
+ MALLOC_TERM; LOCALE_TERM; USER_PROP_MUTEX_TERM; \
amigaos4_dispose_fork_array();
#endif
@@ -154,7 +154,7 @@ int afstat(int fd, struct stat *statb);
# define PERL_SYS_TERM_BODY() \
HINTS_REFCNT_TERM; KEYWORD_PLUGIN_MUTEX_TERM; \
OP_CHECK_MUTEX_TERM; OP_REFCNT_TERM; PERLIO_TERM; \
- MALLOC_TERM; LOCALE_TERM;
+ MALLOC_TERM; LOCALE_TERM; USER_PROP_MUTEX_TERM;
#endif