summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2012-02-11 11:05:51 +0000
committerZefram <zefram@fysh.org>2012-02-11 11:05:51 +0000
commite8570548af49b057631f1011e4b19c8c4a1342dd (patch)
tree250e8d72a232028036906cd58757ad4f86da886c /op.h
parent96a6e6fa4fb95146d6ef6deb911128ac757e1550 (diff)
downloadperl-e8570548af49b057631f1011e4b19c8c4a1342dd.tar.gz
add wrap_op_checker() API function
This function provides a convenient and thread-safe way for modules to hook op checking.
Diffstat (limited to 'op.h')
-rw-r--r--op.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/op.h b/op.h
index f2b5b61dd0..797a8fd178 100644
--- a/op.h
+++ b/op.h
@@ -1000,6 +1000,22 @@ struct token {
*/
/*
+=head1 Hook manipulation
+*/
+
+#ifdef USE_ITHREADS
+# define OP_CHECK_MUTEX_INIT MUTEX_INIT(&PL_check_mutex)
+# define OP_CHECK_MUTEX_LOCK MUTEX_LOCK(&PL_check_mutex)
+# define OP_CHECK_MUTEX_UNLOCK MUTEX_UNLOCK(&PL_check_mutex)
+# define OP_CHECK_MUTEX_TERM MUTEX_DESTROY(&PL_check_mutex)
+#else
+# define OP_CHECK_MUTEX_INIT NOOP
+# define OP_CHECK_MUTEX_LOCK NOOP
+# define OP_CHECK_MUTEX_UNLOCK NOOP
+# define OP_CHECK_MUTEX_TERM NOOP
+#endif
+
+/*
* Local variables:
* c-indentation-style: bsd
* c-basic-offset: 4