diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-08 12:08:17 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-08 12:08:17 +0000 |
commit | 534825c439e9bf017f3cdaf88d284d58d5eac6bd (patch) | |
tree | 1884c58f0eef7d68e5cd924efde5a05d8c8b6e0b /op.h | |
parent | e23b9d0f648442d8e275530c0bf8b0027cee41d1 (diff) | |
download | perl-534825c439e9bf017f3cdaf88d284d58d5eac6bd.tar.gz |
add missing locks for op refcounts
p4raw-id: //depot/perl@5610
Diffstat (limited to 'op.h')
-rw-r--r-- | op.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -401,3 +401,20 @@ struct loop { #define OA_SCALARREF 7 #define OA_OPTIONAL 8 +#ifdef USE_ITHREADS +# define OP_REFCNT_INIT MUTEX_INIT(&PL_op_mutex) +# define OP_REFCNT_LOCK MUTEX_LOCK(&PL_op_mutex) +# define OP_REFCNT_UNLOCK MUTEX_UNLOCK(&PL_op_mutex) +# define OP_REFCNT_TERM MUTEX_DESTROY(&PL_op_mutex) +# define OpREFCNT_set(o,n) ((o)->op_targ = (n)) +# define OpREFCNT_inc(o) ((o) ? (++(o)->op_targ, (o)) : Nullop) +# define OpREFCNT_dec(o) (--(o)->op_targ) +#else +# define OP_REFCNT_INIT NOOP +# define OP_REFCNT_LOCK NOOP +# define OP_REFCNT_UNLOCK NOOP +# define OP_REFCNT_TERM NOOP +# define OpREFCNT_set(o,n) NOOP +# define OpREFCNT_inc(o) (o) +# define OpREFCNT_dec(o) 0 +#endif |