From: Vincent Pit Date: Sat, 2 May 2009 22:53:08 +0000 (+0200) Subject: Introduce the I_THREADSAFE() constant X-Git-Tag: v0.12~7 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=commitdiff_plain;h=a6e7df84c1196a8c6d12692a06d913a24c5d530a Introduce the I_THREADSAFE() constant --- diff --git a/indirect.xs b/indirect.xs index 1e640c8..b19e11a 100644 --- a/indirect.xs +++ b/indirect.xs @@ -528,6 +528,7 @@ PROTOTYPES: ENABLE BOOT: { if (!indirect_initialized++) { + HV *stash; #if I_THREADSAFE MY_CXT_INIT; MY_CXT.tbl = ptable_new(); @@ -548,6 +549,9 @@ BOOT: PL_check[OP_METHOD] = MEMBER_TO_FPTR(indirect_ck_method); indirect_old_ck_entersub = PL_check[OP_ENTERSUB]; PL_check[OP_ENTERSUB] = MEMBER_TO_FPTR(indirect_ck_entersub); + + stash = gv_stashpvn(__PACKAGE__, __PACKAGE_LEN__, 1); + newCONSTSUB(stash, "I_THREADSAFE", newSVuv(I_THREADSAFE)); } } diff --git a/lib/indirect.pm b/lib/indirect.pm index c068be7..4484dae 100644 --- a/lib/indirect.pm +++ b/lib/indirect.pm @@ -73,6 +73,12 @@ sub unimport { (); } +=head1 CONSTANTS + +=head2 C + +True iff the module could have been built when thread-safety features. + =head1 CAVEATS C (no semicolon) at the end of a file won't be seen as an indirect object syntax, although it will as soon as there is another token before the end (as in C or C).