Thanks to H. Merijn Brand for the patch.
Some of the comments and or guards might be removable in perl.h now.
p4raw-id: //depot/perl@11758
/*#define USE_5005THREADS /**/
#define USE_ITHREADS /**/
#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
-#define USE_THREADS /* until src is revised*/
+#define USE_5005THREADS /* until src is revised*/
#endif
/*#define OLD_PTHREADS_API /**/
/*#define USE_REENTRANT_API /**/
void
Perl_set_context(void *t)
{
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
# ifdef USE_DECLSPEC_THREAD
Perl_current_context = t;
# else
void *
Perl_get_context(void)
{
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
# ifdef USE_DECLSPEC_THREAD
return Perl_current_context;
# else
BOOL
Remove_Thread_Ctx(void)
{
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
# ifdef USE_DECLSPEC_THREAD
return TRUE;
# else
typedef long perl_key;
-#if (defined (USE_ITHREADS) || defined (USE_THREADS)) && defined(MPK_ON)
+#if (defined (USE_ITHREADS) || defined (USE_5005THREADS)) && defined(MPK_ON)
#ifdef __cplusplus
extern "C"
{
and indicates that Perl should be built to use SOCKS.
usethreads (usethreads.U):
- This variable conditionally defines the USE_THREADS symbol,
+ This variable conditionally defines the USE_5005THREADS symbol,
and indicates that Perl should be built to use threads.
usevendorprefix (vendorprefix.U):
/*#define USE_5005THREADS / **/
/*#define USE_ITHREADS / **/
#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
-#define USE_THREADS /* until src is revised*/
+#define USE_5005THREADS /* until src is revised*/
#endif
/*#define OLD_PTHREADS_API / **/
/*#define USE_REENTRANT_API / **/
hack I did to grab a bit of extra information from segfaults.
If you have a fancier gdb/threads setup than I do then you'll
have to delete the lines in perl.c which say
- #if defined(DEBUGGING) && defined(USE_THREADS) && defined(__linux__)
+ #if defined(DEBUGGING) && defined(USE_5005THREADS) && defined(__linux__)
DEBUG_S(signal(SIGSEGV, (void(*)(int))catch_sigsegv););
#endif
#$use5005threads USE_5005THREADS /**/
#$useithreads USE_ITHREADS /**/
#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
-#define USE_THREADS /* until src is revised*/
+#define USE_5005THREADS /* until src is revised*/
#endif
#$d_oldpthreads OLD_PTHREADS_API /**/
#$usereentrant USE_REENTRANT_API /**/
CV * cv;
GV * gv;
GV * dfoutgv;
-#ifndef USE_THREADS
+#ifndef USE_5005THREADS
AV * savearray;
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
AV * argarray;
U16 olddepth;
U8 hasargs;
cx->blk_sub.dfoutgv = PL_defoutgv; \
(void)SvREFCNT_inc(cx->blk_sub.dfoutgv)
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
# define POP_SAVEARRAY() NOOP
#else
# define POP_SAVEARRAY() \
SvREFCNT_dec(GvAV(PL_defgv)); \
GvAV(PL_defgv) = cx->blk_sub.savearray; \
} STMT_END
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
/* junk in @_ spells trouble when cloning CVs and in pp_caller(), so don't
* leave any (a fast av_clear(ary), basically) */
long xcv_depth; /* >= 2 indicates recursive call */
AV * xcv_padlist;
CV * xcv_outside;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
perl_mutex *xcv_mutexp;
struct perl_thread *xcv_owner; /* current owner thread */
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
cv_flags_t xcv_flags;
};
#define CvDEPTH(sv) ((XPVCV*)SvANY(sv))->xcv_depth
#define CvPADLIST(sv) ((XPVCV*)SvANY(sv))->xcv_padlist
#define CvOUTSIDE(sv) ((XPVCV*)SvANY(sv))->xcv_outside
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
#define CvMUTEXP(sv) ((XPVCV*)SvANY(sv))->xcv_mutexp
#define CvOWNER(sv) ((XPVCV*)SvANY(sv))->xcv_owner
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#define CvFLAGS(sv) ((XPVCV*)SvANY(sv))->xcv_flags
#define CVf_CLONE 0x0001 /* anon CV uses external lexicals */
#ifdef DEBUGGING
char* file = CopFILE(PL_curcop);
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
PerlIO_printf(Perl_debug_log, "0x%"UVxf" (%s:%ld)\t",
PTR2UV(thr),
(file ? file : "<free>"),
#else
PerlIO_printf(Perl_debug_log, "(%s:%ld)\t", (file ? file : "<free>"),
(long)CopLINE(PL_curcop));
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
(void) PerlIO_vprintf(Perl_debug_log, pat, *args);
#endif /* DEBUGGING */
}
if (*markscan >= i)
break;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
PerlIO_printf(Perl_debug_log,
i ? "0x%"UVxf" => ... " : "0x%lx => ",
PTR2UV(thr));
#else
PerlIO_printf(Perl_debug_log, i ? " => ... " : " => ");
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
if (PL_stack_base[0] != &PL_sv_undef || PL_stack_sp < PL_stack_base)
PerlIO_printf(Perl_debug_log, " [STACK UNDERFLOW!!!]\n");
do {
# if (DJGPP==2 && DJGPP_MINOR < 2)
# define NO_LOCALECONV_MON_THOUSANDS_SEP
# endif
-# ifdef USE_THREADS
+# ifdef USE_5005THREADS
# define OLD_PTHREADS_API
# endif
# define PERL_FS_VER_FMT "%d_%d_%d"
do_gvgv_dump(level, file, " GVGV::GV", CvGV(sv));
Perl_dump_indent(aTHX_ level, file, " FILE = \"%s\"\n", CvFILE(sv));
Perl_dump_indent(aTHX_ level, file, " DEPTH = %"IVdf"\n", (IV)CvDEPTH(sv));
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
Perl_dump_indent(aTHX_ level, file, " MUTEXP = 0x%"UVxf"\n", PTR2UV(CvMUTEXP(sv)));
Perl_dump_indent(aTHX_ level, file, " OWNER = 0x%"UVxf"\n", PTR2UV(CvOWNER(sv)));
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", (UV)CvFLAGS(sv));
if (type == SVt_PVFM)
Perl_dump_indent(aTHX_ level, file, " LINES = %"IVdf"\n", (IV)FmLINES(sv));
#if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE) && defined(F_FREESP)
#define my_chsize Perl_my_chsize
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define condpair_magic Perl_condpair_magic
#endif
#define convert Perl_convert
#define fbm_compile Perl_fbm_compile
#define fbm_instr Perl_fbm_instr
#define find_script Perl_find_script
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define find_threadsv Perl_find_threadsv
#endif
#define force_list Perl_force_list
#define magic_getuvar Perl_magic_getuvar
#define magic_getvec Perl_magic_getvec
#define magic_len Perl_magic_len
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define magic_mutexfree Perl_magic_mutexfree
#endif
#define magic_nextpack Perl_magic_nextpack
#define peep Perl_peep
#if defined(PERL_OBJECT)
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define new_struct_thread Perl_new_struct_thread
#endif
#define call_atexit Perl_call_atexit
#if defined(UNLINK_ALL_VERSIONS)
#define unlnk Perl_unlnk
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define unlock_condpair Perl_unlock_condpair
#endif
#define unsharepvn Perl_unsharepvn
#endif
#define runops_standard Perl_runops_standard
#define runops_debug Perl_runops_debug
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define sv_lock Perl_sv_lock
#endif
#define sv_catpvf_mg Perl_sv_catpvf_mg
#define vcall_body S_vcall_body
#define vcall_list_body S_vcall_list_body
#endif
-# if defined(USE_THREADS)
+# if defined(USE_5005THREADS)
#define init_main_thread S_init_main_thread
# endif
#endif
#if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE) && defined(F_FREESP)
#define my_chsize(a,b) Perl_my_chsize(aTHX_ a,b)
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define condpair_magic(a) Perl_condpair_magic(aTHX_ a)
#endif
#define convert(a,b,c) Perl_convert(aTHX_ a,b,c)
#define fbm_compile(a,b) Perl_fbm_compile(aTHX_ a,b)
#define fbm_instr(a,b,c,d) Perl_fbm_instr(aTHX_ a,b,c,d)
#define find_script(a,b,c,d) Perl_find_script(aTHX_ a,b,c,d)
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define find_threadsv(a) Perl_find_threadsv(aTHX_ a)
#endif
#define force_list(a) Perl_force_list(aTHX_ a)
#define magic_getuvar(a,b) Perl_magic_getuvar(aTHX_ a,b)
#define magic_getvec(a,b) Perl_magic_getvec(aTHX_ a,b)
#define magic_len(a,b) Perl_magic_len(aTHX_ a,b)
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define magic_mutexfree(a,b) Perl_magic_mutexfree(aTHX_ a,b)
#endif
#define magic_nextpack(a,b,c) Perl_magic_nextpack(aTHX_ a,b,c)
#define peep(a) Perl_peep(aTHX_ a)
#if defined(PERL_OBJECT)
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define new_struct_thread(a) Perl_new_struct_thread(aTHX_ a)
#endif
#define call_atexit(a,b) Perl_call_atexit(aTHX_ a,b)
#if defined(UNLINK_ALL_VERSIONS)
#define unlnk(a) Perl_unlnk(aTHX_ a)
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define unlock_condpair(a) Perl_unlock_condpair(aTHX_ a)
#endif
#define unsharepvn(a,b,c) Perl_unsharepvn(aTHX_ a,b,c)
#endif
#define runops_standard() Perl_runops_standard(aTHX)
#define runops_debug() Perl_runops_debug(aTHX)
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define sv_lock(a) Perl_sv_lock(aTHX_ a)
#endif
#define sv_vcatpvf_mg(a,b,c) Perl_sv_vcatpvf_mg(aTHX_ a,b,c)
#define vcall_body(a) S_vcall_body(aTHX_ a)
#define vcall_list_body(a) S_vcall_list_body(aTHX_ a)
#endif
-# if defined(USE_THREADS)
+# if defined(USE_5005THREADS)
#define init_main_thread() S_init_main_thread(aTHX)
# endif
#endif
#define Perl_my_chsize CPerlObj::Perl_my_chsize
#define my_chsize Perl_my_chsize
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define Perl_condpair_magic CPerlObj::Perl_condpair_magic
#define condpair_magic Perl_condpair_magic
#endif
#define fbm_instr Perl_fbm_instr
#define Perl_find_script CPerlObj::Perl_find_script
#define find_script Perl_find_script
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define Perl_find_threadsv CPerlObj::Perl_find_threadsv
#define find_threadsv Perl_find_threadsv
#endif
#define magic_getvec Perl_magic_getvec
#define Perl_magic_len CPerlObj::Perl_magic_len
#define magic_len Perl_magic_len
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define Perl_magic_mutexfree CPerlObj::Perl_magic_mutexfree
#define magic_mutexfree Perl_magic_mutexfree
#endif
#define Perl_run CPerlObj::Perl_run
#define Perl_parse CPerlObj::Perl_parse
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define Perl_new_struct_thread CPerlObj::Perl_new_struct_thread
#define new_struct_thread Perl_new_struct_thread
#endif
#define Perl_unlnk CPerlObj::Perl_unlnk
#define unlnk Perl_unlnk
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define Perl_unlock_condpair CPerlObj::Perl_unlock_condpair
#define unlock_condpair Perl_unlock_condpair
#endif
#define runops_standard Perl_runops_standard
#define Perl_runops_debug CPerlObj::Perl_runops_debug
#define runops_debug Perl_runops_debug
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#define Perl_sv_lock CPerlObj::Perl_sv_lock
#define sv_lock Perl_sv_lock
#endif
#define S_vcall_list_body CPerlObj::S_vcall_list_body
#define vcall_list_body S_vcall_list_body
#endif
-# if defined(USE_THREADS)
+# if defined(USE_5005THREADS)
#define S_init_main_thread CPerlObj::S_init_main_thread
#define init_main_thread S_init_main_thread
# endif
/* (Doing namespace management portably in C is really gross.) */
/*
- The following combinations of MULTIPLICITY, USE_THREADS, PERL_OBJECT
+ The following combinations of MULTIPLICITY, USE_5005THREADS, PERL_OBJECT
and PERL_IMPLICIT_CONTEXT are supported:
1) none
2) MULTIPLICITY # supported for compatibility
3) MULTIPLICITY && PERL_IMPLICIT_CONTEXT
- 4) USE_THREADS && PERL_IMPLICIT_CONTEXT
- 5) MULTIPLICITY && USE_THREADS && PERL_IMPLICIT_CONTEXT
+ 4) USE_5005THREADS && PERL_IMPLICIT_CONTEXT
+ 5) MULTIPLICITY && USE_5005THREADS && PERL_IMPLICIT_CONTEXT
6) PERL_OBJECT && PERL_IMPLICIT_CONTEXT
All other combinations of these flags are errors.
# include "error: PERL_OBJECT + MULTIPLICITY don't go together"
# endif
-# if defined(USE_THREADS)
+# if defined(USE_5005THREADS)
/* case 5 above */
END
print EM <<'END';
-# else /* !USE_THREADS */
+# else /* !USE_5005THREADS */
/* cases 2 and 3 above */
END
print EM <<'END';
-# endif /* USE_THREADS */
+# endif /* USE_5005THREADS */
#else /* !MULTIPLICITY */
print EM <<'END';
-# if defined(USE_THREADS)
+# if defined(USE_5005THREADS)
/* case 4 above */
END
print EM <<'END';
-# else /* !USE_THREADS */
+# else /* !USE_5005THREADS */
/* case 1 above */
END
print EM <<'END';
-# endif /* USE_THREADS */
+# endif /* USE_5005THREADS */
# endif /* PERL_OBJECT */
#endif /* MULTIPLICITY */
#if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE) && defined(F_FREESP)
Ap |I32 |my_chsize |int fd|Off_t length
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
Ap |MAGIC* |condpair_magic |SV *sv
#endif
p |OP* |convert |I32 optype|I32 flags|OP* o
|SV* littlesv|U32 flags
p |char* |find_script |char *scriptname|bool dosearch \
|char **search_ext|I32 flags
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
p |PADOFFSET|find_threadsv|const char *name
#endif
p |OP* |force_list |OP* arg
p |int |magic_getuvar |SV* sv|MAGIC* mg
p |int |magic_getvec |SV* sv|MAGIC* mg
p |U32 |magic_len |SV* sv|MAGIC* mg
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
p |int |magic_mutexfree|SV* sv|MAGIC* mg
#endif
p |int |magic_nextpack |SV* sv|MAGIC* mg|SV* key
Aox |int |Perl_parse |XSINIT_t xsinit \
|int argc|char** argv|char** env
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
Ap |struct perl_thread* |new_struct_thread|struct perl_thread *t
#endif
Ap |void |call_atexit |ATEXIT_t fn|void *ptr
#if defined(UNLINK_ALL_VERSIONS)
Ap |I32 |unlnk |char* f
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
Ap |void |unlock_condpair|void* svv
#endif
Ap |void |unsharepvn |const char* sv|I32 len|U32 hash
#endif
Ap |int |runops_standard
Ap |int |runops_debug
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
Ap |SV* |sv_lock |SV *sv
#endif
Afpd |void |sv_catpvf_mg |SV *sv|const char* pat|...
s |void* |vcall_body |va_list args
s |void* |vcall_list_body|va_list args
#endif
-# if defined(USE_THREADS)
+# if defined(USE_5005THREADS)
s |struct perl_thread * |init_main_thread
# endif
#endif
/* (Doing namespace management portably in C is really gross.) */
/*
- The following combinations of MULTIPLICITY, USE_THREADS, PERL_OBJECT
+ The following combinations of MULTIPLICITY, USE_5005THREADS, PERL_OBJECT
and PERL_IMPLICIT_CONTEXT are supported:
1) none
2) MULTIPLICITY # supported for compatibility
3) MULTIPLICITY && PERL_IMPLICIT_CONTEXT
- 4) USE_THREADS && PERL_IMPLICIT_CONTEXT
- 5) MULTIPLICITY && USE_THREADS && PERL_IMPLICIT_CONTEXT
+ 4) USE_5005THREADS && PERL_IMPLICIT_CONTEXT
+ 5) MULTIPLICITY && USE_5005THREADS && PERL_IMPLICIT_CONTEXT
6) PERL_OBJECT && PERL_IMPLICIT_CONTEXT
All other combinations of these flags are errors.
# include "error: PERL_OBJECT + MULTIPLICITY don't go together"
# endif
-# if defined(USE_THREADS)
+# if defined(USE_5005THREADS)
/* case 5 above */
#define PL_Argv (PERL_GET_INTERP->IArgv)
#define PL_yynerrs (PERL_GET_INTERP->Iyynerrs)
#define PL_yyval (PERL_GET_INTERP->Iyyval)
-# else /* !USE_THREADS */
+# else /* !USE_5005THREADS */
/* cases 2 and 3 above */
#define PL_Argv (vTHX->IArgv)
#define PL_yynerrs (vTHX->Iyynerrs)
#define PL_yyval (vTHX->Iyyval)
-# endif /* USE_THREADS */
+# endif /* USE_5005THREADS */
#else /* !MULTIPLICITY */
#define PL_Iyynerrs PL_yynerrs
#define PL_Iyyval PL_yyval
-# if defined(USE_THREADS)
+# if defined(USE_5005THREADS)
/* case 4 above */
#define PL_Sv (aTHX->TSv)
#define PL_watchaddr (aTHX->Twatchaddr)
#define PL_watchok (aTHX->Twatchok)
-# else /* !USE_THREADS */
+# else /* !USE_5005THREADS */
/* case 1 above */
#define PL_TSv PL_Sv
#define PL_Twatchaddr PL_watchaddr
#define PL_Twatchok PL_watchok
-# endif /* USE_THREADS */
+# endif /* USE_5005THREADS */
# endif /* PERL_OBJECT */
#endif /* MULTIPLICITY */
void
threadsv_names()
PPCODE:
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
int i;
STRLEN len = strlen(PL_threadsv_names);
long xcv_depth; /* >= 2 indicates recursive call */
AV * xcv_padlist;
CV * xcv_outside;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
perl_mutex *xcv_mutexp;
struct perl_thread *xcv_owner; /* current owner thread */
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
cv_flags_t xcv_flags;
} XPVCV_or_similar;
#define ANYINIT(i) i
# - package declarations using cop_stash
# - subs, formats and code sorted by cop_seq
# Changes between 0.51 and 0.52:
-# - added pp_threadsv (special variables under USE_THREADS)
+# - added pp_threadsv (special variables under USE_5005THREADS)
# - added documentation
# Changes between 0.52 and 0.53:
# - many changes adding precedence contexts and associativity
getlogin
syscall
lock 6 1
-threadsv 6 2 unused if not USE_THREADS
+threadsv 6 2 unused if not USE_5005THREADS
setstate 1 1 currently unused anywhere
method_named 10 2
int msgsiz;
char *msg;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
char *buf = malloc(BUFSIZ);
if (buf == 0)
int msgsiz;
char *msg;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
char *buf = malloc(BUFSIZ);
if (buf == 0)
static void
remove_thread(pTHX_ Thread t)
{
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
DEBUG_S(WITH_THR(PerlIO_printf(Perl_debug_log,
"%p: remove_thread %p\n", thr, t)));
MUTEX_LOCK(&PL_threads_mutex);
static THREAD_RET_TYPE
threadstart(void *arg)
{
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
#ifdef FAKE_THREADS
Thread savethread = thr;
LOGOP myop;
static SV *
newthread (pTHX_ SV *startsv, AV *initargs, char *classname)
{
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
dSP;
Thread savethread;
int i;
AV * av = NO_INIT
int i = NO_INIT
PPCODE:
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
if (t == thr)
croak("Attempt to join self");
DEBUG_S(PerlIO_printf(Perl_debug_log, "%p: joining %p (state %u)\n",
detach(t)
Thread t
CODE:
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
DEBUG_S(PerlIO_printf(Perl_debug_log, "%p: detaching %p (state %u)\n",
thr, t, ThrSTATE(t)));
MUTEX_LOCK(&t->mutex);
flags(t)
Thread t
PPCODE:
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
PUSHs(sv_2mortal(newSViv(t->flags)));
#endif
done(t)
Thread t
PPCODE:
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
PUSHs(t->thr_done ? &PL_sv_yes : &PL_sv_no);
#endif
PREINIT:
SV *sv;
PPCODE:
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
sv = newSViv(thr->tid);
sv_magic(sv, thr->oursv, '~', 0, 0);
SvMAGIC(sv)->mg_private = Thread_MAGIC_SIGNATURE;
tid(t)
Thread t
CODE:
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
MUTEX_LOCK(&t->mutex);
RETVAL = t->tid;
MUTEX_UNLOCK(&t->mutex);
yield()
CODE:
{
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
YIELD;
#endif
}
SV * sv
MAGIC * mg = NO_INIT
CODE:
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
if (SvROK(sv))
sv = SvRV(sv);
SV * sv
MAGIC * mg = NO_INIT
CODE:
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
if (SvROK(sv))
sv = SvRV(sv);
SV * sv
MAGIC * mg = NO_INIT
CODE:
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
if (SvROK(sv))
sv = SvRV(sv);
SV ** svp;
int n = 0;
PPCODE:
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
av = newAV();
/*
* Iterate until we have enough dynamic storage for all threads.
data(classname = "Thread::Specific")
char * classname
PPCODE:
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
if (AvFILL(thr->specific) == -1) {
GV *gv = gv_fetchpv("Thread::Specific::FIELDS", TRUE, SVt_PVHV);
av_store(thr->specific, 0, newRV((SV*)GvHV(gv)));
CvGV(GvCV(gv)) = gv;
CvFILE_set_from_cop(GvCV(gv), PL_curcop);
CvSTASH(GvCV(gv)) = PL_curstash;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
CvOWNER(GvCV(gv)) = 0;
if (!CvMUTEXP(GvCV(gv))) {
New(666, CvMUTEXP(GvCV(gv)), 1, perl_mutex);
MUTEX_INIT(CvMUTEXP(GvCV(gv)));
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
if (proto) {
sv_setpv((SV*)GvCV(gv), proto);
Safefree(proto);
"Use of inherited AUTOLOAD for non-method %s::%.*s() is deprecated",
HvNAME(stash), (int)len, name);
-#ifndef USE_THREADS
+#ifndef USE_5005THREADS
if (CvXSUB(cv)) {
/* rather than lookup/init $AUTOLOAD here
* only to have the XSUB do another lookup for $AUTOLOAD
vargv = *(GV**)hv_fetch(varstash, autoload, autolen, TRUE);
ENTER;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
sv_lock((SV *)varstash);
#endif
if (!isGV(vargv))
gv_init(vargv, varstash, autoload, autolen, FALSE);
LEAVE;
varsv = GvSV(vargv);
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
sv_lock(varsv);
#endif
sv_setpv(varsv, HvNAME(stash));
/* shortcuts to regexp stuff */
/* this one needs to be moved to thrdvar.h and accessed via
- * find_threadsv() when USE_THREADS */
+ * find_threadsv() when USE_5005THREADS */
PERLVAR(Ireplgv, GV *)
/* shortcuts to misc objects */
PERLVAR(Ipending_ident, char) /* pending identifier lookup */
PERLVAR(Isublex_info, SUBLEXINFO) /* from toke.c */
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
PERLVAR(Ithrsv, SV *) /* struct perl_thread for main thread */
PERLVARI(Ithreadnum, U32, 0) /* incremented each thread creation */
PERLVAR(Istrtab_mutex, perl_mutex) /* Mutex for string table access */
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
PERLVAR(Iuid, Uid_t) /* current real user id */
PERLVAR(Ieuid, Uid_t) /* current effective user id */
PERLVARA(Iuudmap,256, char)
PERLVAR(Ibitcount, char *)
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
PERLVAR(Isv_mutex, perl_mutex) /* Mutex for allocating SVs in sv.c */
PERLVAR(Ieval_mutex, perl_mutex) /* Mutex for doeval */
PERLVAR(Ieval_cond, perl_cond) /* Condition variable for doeval */
PERLVAR(Icred_mutex, perl_mutex) /* altered credentials in effect */
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
PERLVAR(Ipsig_ptr, SV**)
PERLVAR(Ipsig_name, SV**)
#endif
PERLVARI(Ibeginav_save, AV*, Nullav) /* save BEGIN{}s when compiling */
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
PERLVAR(Ifdpid_mutex, perl_mutex) /* mutex for fdpid array */
PERLVAR(Isv_lock_mutex, perl_mutex) /* mutex for SvLOCK macro */
#endif
case '0':
break;
#endif
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
case '@':
sv_setsv(sv, thr->errsv);
break;
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
}
return 0;
}
}
break;
#endif
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
case '@':
sv_setsv(thr->errsv, sv);
break;
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
}
return 0;
}
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
int
Perl_magic_mutexfree(pTHX_ SV *sv, MAGIC *mg)
{
COND_DESTROY(MgCONDP(mg));
return 0;
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
I32
Perl_whichsig(pTHX_ char *sig)
PERL_SYS_INIT3(&argc,&argv,&env);
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
/* XXX Ideally, this should really be happening in perl_alloc() or
* perl_construct() to keep libperl.a transparently fork()-safe.
* It is currently done here only because Apache/mod_perl have
#undef my_chsize
#define my_chsize Perl_my_chsize
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#undef Perl_condpair_magic
#define Perl_condpair_magic pPerl->Perl_condpair_magic
#undef condpair_magic
#define Perl_fbm_instr pPerl->Perl_fbm_instr
#undef fbm_instr
#define fbm_instr Perl_fbm_instr
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#endif
#undef Perl_form
#define Perl_form pPerl->Perl_form
#define Perl_grok_numeric_radix pPerl->Perl_grok_numeric_radix
#undef grok_numeric_radix
#define grok_numeric_radix Perl_grok_numeric_radix
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#endif
#if defined(USE_LOCALE_COLLATE)
#endif
#undef Perl_parse
#define Perl_parse pPerl->Perl_parse
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#undef Perl_new_struct_thread
#define Perl_new_struct_thread pPerl->Perl_new_struct_thread
#undef new_struct_thread
#undef unlnk
#define unlnk Perl_unlnk
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#undef Perl_unlock_condpair
#define Perl_unlock_condpair pPerl->Perl_unlock_condpair
#undef unlock_condpair
#define Perl_runops_debug pPerl->Perl_runops_debug
#undef runops_debug
#define runops_debug Perl_runops_debug
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#undef Perl_sv_lock
#define Perl_sv_lock pPerl->Perl_sv_lock
#undef sv_lock
# endif
#if defined(PERL_FLEXIBLE_EXCEPTIONS)
#endif
-# if defined(USE_THREADS)
+# if defined(USE_5005THREADS)
# endif
#endif
#if defined(PERL_IN_PP_C) || defined(PERL_DECL_PROT)
PERL_CONTEXT *cx;
CV *outside;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
/*
* Special case to get lexical (and hence per-thread) @_.
* XXX I need to find out how to tell at parse-time whether use
*/
if (strEQ(name, "@_"))
return 0; /* success. (NOT_IN_PAD indicates failure) */
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
/* The one we're looking for is probably just before comppad_name_fill. */
for (off = AvFILLp(PL_comppad_name); off > 0; off--) {
}
SvFLAGS(sv) |= tmptype;
PL_curpad = AvARRAY(PL_comppad);
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
DEBUG_X(PerlIO_printf(Perl_debug_log,
"0x%"UVxf" Pad 0x%"UVxf" alloc %ld for %s\n",
PTR2UV(thr), PTR2UV(PL_curpad),
"Pad 0x%"UVxf" alloc %ld for %s\n",
PTR2UV(PL_curpad),
(long) retval, PL_op_name[optype]));
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
return (PADOFFSET)retval;
}
SV *
Perl_pad_sv(pTHX_ PADOFFSET po)
{
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
DEBUG_X(PerlIO_printf(Perl_debug_log,
"0x%"UVxf" Pad 0x%"UVxf" sv %"IVdf"\n",
PTR2UV(thr), PTR2UV(PL_curpad), (IV)po));
Perl_croak(aTHX_ "panic: pad_sv po");
DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%"UVxf" sv %"IVdf"\n",
PTR2UV(PL_curpad), (IV)po));
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
return PL_curpad[po]; /* eventually we'll turn this into a macro */
}
Perl_croak(aTHX_ "panic: pad_free curpad");
if (!po)
Perl_croak(aTHX_ "panic: pad_free po");
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
DEBUG_X(PerlIO_printf(Perl_debug_log,
"0x%"UVxf" Pad 0x%"UVxf" free %"IVdf"\n",
PTR2UV(thr), PTR2UV(PL_curpad), (IV)po));
#else
DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%"UVxf" free %"IVdf"\n",
PTR2UV(PL_curpad), (IV)po));
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
if (PL_curpad[po] && PL_curpad[po] != &PL_sv_undef) {
SvPADTMP_off(PL_curpad[po]);
#ifdef USE_ITHREADS
Perl_croak(aTHX_ "panic: pad_swipe curpad");
if (!po)
Perl_croak(aTHX_ "panic: pad_swipe po");
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
DEBUG_X(PerlIO_printf(Perl_debug_log,
"0x%"UVxf" Pad 0x%"UVxf" swipe %"IVdf"\n",
PTR2UV(thr), PTR2UV(PL_curpad), (IV)po));
#else
DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%"UVxf" swipe %"IVdf"\n",
PTR2UV(PL_curpad), (IV)po));
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
SvPADTMP_off(PL_curpad[po]);
PL_curpad[po] = NEWSV(1107,0);
SvPADTMP_on(PL_curpad[po]);
if (AvARRAY(PL_comppad) != PL_curpad)
Perl_croak(aTHX_ "panic: pad_reset curpad");
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
DEBUG_X(PerlIO_printf(Perl_debug_log,
"0x%"UVxf" Pad 0x%"UVxf" reset\n",
PTR2UV(thr), PTR2UV(PL_curpad)));
#else
DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%"UVxf" reset\n",
PTR2UV(PL_curpad)));
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
if (!PL_tainting) { /* Can't mix tainted and non-tainted temporaries. */
for (po = AvMAX(PL_comppad); po > PL_padix_floor; po--) {
if (PL_curpad[po] && !SvIMMORTAL(PL_curpad[po]))
PL_pad_reset_pending = FALSE;
}
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
/* find_threadsv is not reentrant */
PADOFFSET
Perl_find_threadsv(pTHX_ const char *name)
}
return key;
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
/* Destructor */
switch (o->op_type) {
case OP_NULL: /* Was holding old type, if any. */
case OP_ENTEREVAL: /* Was holding hints. */
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
case OP_THREADSV: /* Was holding index into thr->threadsv AV. */
#endif
o->op_targ = 0;
break;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
case OP_ENTERITER:
if (!(o->op_flags & OPf_SPECIAL))
break;
/* FALL THROUGH */
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
default:
if (!(o->op_flags & OPf_REF)
|| (PL_check[o->op_type] != MEMBER_TO_FPTR(Perl_ck_ftst)))
SvPV(*av_fetch(PL_comppad_name, o->op_targ, 4), n_a));
break;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
case OP_THREADSV:
PL_modcount++; /* XXX ??? */
break;
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
case OP_PUSHMARK:
break;
STATIC OP *
S_newDEFSVOP(pTHX)
{
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
OP *o = newOP(OP_THREADSV, 0);
o->op_targ = find_threadsv("_");
return o;
#else
return newSVREF(newGVOP(OP_GV, 0, PL_defgv));
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
}
void
{
if (o->op_type == OP_LIST) {
OP *o2;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
o2 = newOP(OP_THREADSV, 0);
o2->op_targ = find_threadsv(";");
#else
o2 = newSVREF(newGVOP(OP_GV, 0, gv_fetchpv(";", TRUE, SVt_PV))),
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
o = convert(OP_JOIN, 0, prepend_elem(OP_LIST, o2, o));
}
return o;
if (CopLINE(PL_curcop) < PL_multi_end)
CopLINE_set(PL_curcop, PL_multi_end);
}
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
else if (repl->op_type == OP_THREADSV
&& strchr("&`'123456789+",
PL_threadsv_names[repl->op_targ]))
{
curop = 0;
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
else if (repl->op_type == OP_CONST)
curop = repl;
else {
OP *lastop = 0;
for (curop = LINKLIST(repl); curop!=repl; curop = LINKLIST(curop)) {
if (PL_opargs[curop->op_type] & OA_DANGEROUS) {
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
if (curop->op_type == OP_THREADSV) {
repl_has_vars = 1;
if (strchr("&`'123456789+", curop->op_private))
if (strchr("&`'123456789+", *GvENAME(gv)))
break;
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
else if (curop->op_type == OP_RV2CV)
break;
else if (curop->op_type == OP_RV2SV ||
Perl_croak(aTHX_ "Can't use %s for loop variable", PL_op_desc[sv->op_type]);
}
else {
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
padoff = find_threadsv("_");
iterflags |= OPf_SPECIAL;
#else
void
Perl_cv_undef(pTHX_ CV *cv)
{
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
if (CvMUTEXP(cv)) {
MUTEX_DESTROY(CvMUTEXP(cv));
Safefree(CvMUTEXP(cv));
CvMUTEXP(cv) = 0;
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#ifdef USE_ITHREADS
if (CvFILE(cv) && !CvXSUB(cv)) {
#endif
if (!CvXSUB(cv) && CvROOT(cv)) {
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
if (CvDEPTH(cv) || (CvOWNER(cv) && CvOWNER(cv) != thr))
Perl_croak(aTHX_ "Can't undef active subroutine");
#else
if (CvDEPTH(cv))
Perl_croak(aTHX_ "Can't undef active subroutine");
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
ENTER;
SAVEVPTR(PL_curpad);
CvFLAGS(cv) = CvFLAGS(proto) & ~CVf_CLONE;
CvCLONED_on(cv);
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
New(666, CvMUTEXP(cv), 1, perl_mutex);
MUTEX_INIT(CvMUTEXP(cv));
CvOWNER(cv) = 0;
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#ifdef USE_ITHREADS
CvFILE(cv) = CvXSUB(proto) ? CvFILE(proto)
: savepv(CvFILE(proto));
CvGV(cv) = gv;
CvFILE_set_from_cop(cv, PL_curcop);
CvSTASH(cv) = PL_curstash;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
CvOWNER(cv) = 0;
if (!CvMUTEXP(cv)) {
New(666, CvMUTEXP(cv), 1, perl_mutex);
MUTEX_INIT(CvMUTEXP(cv));
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
if (ps)
sv_setpv((SV*)cv, ps);
}
}
CvGV(cv) = gv;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
New(666, CvMUTEXP(cv), 1, perl_mutex);
MUTEX_INIT(CvMUTEXP(cv));
CvOWNER(cv) = 0;
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
(void)gv_fetchfile(filename);
CvFILE(cv) = filename; /* NOTE: not copied, as it is expected to be
an external constant string */
OP *argop;
op_free(o);
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
if (!CvUNIQUE(PL_compcv)) {
argop = newOP(OP_PADAV, OPf_REF);
argop->op_targ = 0; /* PL_curpad[0] is @_ */
argop = newUNOP(OP_RV2AV, 0,
scalar(newGVOP(OP_GV, 0, !CvUNIQUE(PL_compcv) ?
PL_defgv : gv_fetchpv("ARGV", TRUE, SVt_PVAV))));
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
return newUNOP(type, 0, scalar(argop));
}
return scalar(modkids(ck_fun(o), type));
#include "EXTERN.h"
#include "perl.h"
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
typedef void (*emx_startroutine)(void *);
typedef void* (*pthreads_startroutine)(void *);
}
avlen --;
}
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
sum++; /* Avoid conflict of DLLs in memory. */
#endif
/* We always load modules as *specific* DLLs, and with the full name.
# undef I_SYS_UN
#endif
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
#define do_spawn(a) os2_do_spawn(aTHX_ (a))
#define do_aspawn(a,b,c) os2_do_aspawn(aTHX_ (a),(b),(c))
#define THREADS_ELSEWHERE
-#else /* USE_THREADS */
+#else /* USE_5005THREADS */
#define do_spawn(a) os2_do_spawn(a)
#define do_aspawn(a,b,c) os2_do_aspawn((a),(b),(c))
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
void Perl_OS2_init(char **);
void Perl_OS2_init3(char **envp, void **excH, int flags);
#define perl_free Perl_free
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
# define INIT_TLS_AND_INTERP \
STMT_START { \
if (!PL_curinterp) { \
void
perl_construct(pTHXx)
{
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
#ifndef FAKE_THREADS
struct perl_thread *thr = NULL;
#endif /* FAKE_THREADS */
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#ifdef MULTIPLICITY
init_interp();
/* Init the real globals (and main thread)? */
if (!PL_linestr) {
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
MUTEX_INIT(&PL_sv_mutex);
/*
* Safe to use basic SV functions from now on (though
MUTEX_INIT(&PL_fdpid_mutex);
thr = init_main_thread();
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#ifdef PERL_FLEXIBLE_EXCEPTIONS
PL_protect = MEMBER_TO_FPTR(Perl_default_protect); /* for exceptions */
{
int destruct_level; /* 0=none, 1=full, 2=full with checks */
HV *hv;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
Thread t;
dTHX;
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
/* wait for all pseudo-forked children to finish */
PERL_WAIT_FOR_CHILDREN;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
#ifndef FAKE_THREADS
/* Pass 1 on any remaining threads: detach joinables, join zombies */
retry_cleanup:
COND_DESTROY(&PL_nthreads_cond);
PL_nthreads--;
#endif /* !defined(FAKE_THREADS) */
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
destruct_level = PL_perl_destruct_level;
#ifdef DEBUGGING
PL_hints = 0; /* Reset hints. Should hints be per-interpreter ? */
DEBUG_P(debprofdump());
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
MUTEX_DESTROY(&PL_strtab_mutex);
MUTEX_DESTROY(&PL_sv_mutex);
MUTEX_DESTROY(&PL_eval_mutex);
Safefree(SvANY(PL_thrsv));
Safefree(PL_thrsv);
PL_thrsv = Nullsv;
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#ifdef USE_REENTRANT_API
Safefree(PL_reentrant_buffer->tmbuff);
I32 oldscope;
int ret;
dJMPENV;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
dTHX;
#endif
# ifdef MULTIPLICITY
sv_catpv(PL_Sv," MULTIPLICITY");
# endif
-# ifdef USE_THREADS
- sv_catpv(PL_Sv," USE_THREADS");
+# ifdef USE_5005THREADS
+ sv_catpv(PL_Sv," USE_5005THREADS");
# endif
# ifdef USE_ITHREADS
sv_catpv(PL_Sv," USE_ITHREADS");
PL_comppad_name_fill = 0;
PL_min_intro_pending = 0;
PL_padix = 0;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
av_store(PL_comppad_name, 0, newSVpvn("@_", 2));
PL_curpad[0] = (SV*)newAV();
SvPADMY_on(PL_curpad[0]); /* XXX Needed? */
CvOWNER(PL_compcv) = 0;
New(666, CvMUTEXP(PL_compcv), 1, perl_mutex);
MUTEX_INIT(CvMUTEXP(PL_compcv));
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
comppadlist = newAV();
AvREAL_off(comppadlist);
I32 oldscope;
int ret = 0;
dJMPENV;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
dTHX;
#endif
Perl_get_sv(pTHX_ const char *name, I32 create)
{
GV *gv;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
if (name[1] == '\0' && !isALPHA(name[0])) {
PADOFFSET tmp = find_threadsv(name);
if (tmp != NOT_IN_PAD)
return THREADSV(tmp);
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
gv = gv_fetchpv(name, create, SVt_PV);
if (gv)
return GvSV(gv);
# define PERLVAR(var,type)
# define PERLVARA(var,n,type)
# if defined(PERL_IMPLICIT_CONTEXT)
-# if defined(USE_THREADS)
+# if defined(USE_5005THREADS)
# define PERLVARI(var,type,init) PERL_GET_INTERP->var = init;
# define PERLVARIC(var,type,init) PERL_GET_INTERP->var = init;
-# else /* !USE_THREADS */
+# else /* !USE_5005THREADS */
# define PERLVARI(var,type,init) aTHX->var = init;
# define PERLVARIC(var,type,init) aTHX->var = init;
-# endif /* USE_THREADS */
+# endif /* USE_5005THREADS */
# else
# define PERLVARI(var,type,init) PERL_GET_INTERP->var = init;
# define PERLVARIC(var,type,init) PERL_GET_INTERP->var = init;
# endif
# include "intrpvar.h"
-# ifndef USE_THREADS
+# ifndef USE_5005THREADS
# include "thrdvar.h"
# endif
# undef PERLVAR
# define PERLVARI(var,type,init) PL_##var = init;
# define PERLVARIC(var,type,init) PL_##var = init;
# include "intrpvar.h"
-# ifndef USE_THREADS
+# ifndef USE_5005THREADS
# include "thrdvar.h"
# endif
# undef PERLVAR
about not iterating on it, and not adding tie magic to it.
It is properly deallocated in perl_destruct() */
PL_strtab = newHV();
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
MUTEX_INIT(&PL_strtab_mutex);
#endif
HvSHAREKEYS_off(PL_strtab); /* mandatory */
}
}
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
STATIC struct perl_thread *
S_init_main_thread(pTHX)
{
return thr;
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
void
Perl_call_list(pTHX_ I32 oldscope, AV *paramList)
/* XXX This next guard can disappear if the sources are revised
to use USE_5005THREADS throughout. -- A.D 1/6/2000
*/
-#if defined(USE_ITHREADS) && defined(USE_THREADS)
-# include "error: USE_ITHREADS and USE_THREADS are incompatible"
+#if defined(USE_ITHREADS) && defined(USE_5005THREADS)
+# include "error: USE_ITHREADS and USE_5005THREADS are incompatible"
#endif
/* See L<perlguts/"The Perl API"> for detailed notes on
# endif
#endif
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
# ifndef PERL_IMPLICIT_CONTEXT
# define PERL_IMPLICIT_CONTEXT
# endif
#else /* !PERL_OBJECT */
#ifdef PERL_IMPLICIT_CONTEXT
-# ifdef USE_THREADS
+# ifdef USE_5005THREADS
struct perl_thread;
# define pTHX register struct perl_thread *thr
# define aTHX thr
/* HP-UX 10.X CMA (Common Multithreaded Architecure) insists that
pthread.h must be included before all other header files.
*/
-#if (defined(USE_THREADS) || defined(USE_ITHREADS)) \
+#if (defined(USE_5005THREADS) || defined(USE_ITHREADS)) \
&& defined(PTHREAD_H_FIRST) && defined(I_PTHREAD)
# include <pthread.h>
#endif
# define INCLUDE_PROTOTYPES /* for <socks.h> */
# define PERL_SOCKS_NEED_PROTOTYPES
# endif
-# ifdef USE_THREADS
+# ifdef USE_5005THREADS
# define PERL_USE_THREADS /* store our value */
-# undef USE_THREADS
+# undef USE_5005THREADS
# endif
# include <socks.h>
-# ifdef USE_THREADS
-# undef USE_THREADS /* socks.h does this on its own */
+# ifdef USE_5005THREADS
+# undef USE_5005THREADS /* socks.h does this on its own */
# endif
# ifdef PERL_USE_THREADS
-# define USE_THREADS /* restore our value */
+# define USE_5005THREADS /* restore our value */
# undef PERL_USE_THREADS
# endif
# ifdef PERL_SOCKS_NEED_PROTOTYPES /* keep cpp space clean */
# define SETERRNO(errcode,vmserrcode) (errno = (errcode))
#endif
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
# define ERRSV (thr->errsv)
# define DEFSV THREADSV(0)
# define SAVE_DEFSV save_threadsv(0)
# define ERRSV GvSV(PL_errgv)
# define DEFSV GvSV(PL_defgv)
# define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#define ERRHV GvHV(PL_errgv) /* XXX unused, here for compatibility */
#endif
/*
- * USE_THREADS needs to be after unixish.h as <pthread.h> includes
+ * USE_5005THREADS needs to be after unixish.h as <pthread.h> includes
* <sys/signal.h> which defines NSIG - which will stop inclusion of <signal.h>
* this results in many functions being undeclared which bothers C++
* May make sense to have threads after "*ish.h" anyway
*/
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
-# if defined(USE_THREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
+# if defined(USE_5005THREADS)
/* pending resolution of licensing issues, we avoid the erstwhile
* atomic.h everywhere */
# define EMULATE_ATOMIC_REFCOUNTS
# endif /* WIN32 */
# endif /* FAKE_THREADS */
#endif /* NETWARE */
-#endif /* USE_THREADS || USE_ITHREADS */
+#endif /* USE_5005THREADS || USE_ITHREADS */
#ifdef WIN32
# include "win32.h"
#endif
#if defined(PERL_IMPLICIT_CONTEXT) && !defined(PERL_GET_THX)
-# ifdef USE_THREADS
+# ifdef USE_5005THREADS
# define PERL_GET_THX ((struct perl_thread *)PERL_GET_CONTEXT)
# else
# ifdef MULTIPLICITY
};
#endif
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
#define ARGSproto struct perl_thread *thr
#else
#define ARGSproto
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
typedef I32 (*filter_t) (pTHXo_ int, SV *, int);
# define DEBUG_X(a) DEBUG__(DEBUG_X_TEST, a)
# define DEBUG_D(a) DEBUG__(DEBUG_D_TEST, a)
-# ifdef USE_THREADS
+# ifdef USE_5005THREADS
# define DEBUG_S(a) DEBUG__(DEBUG_S_TEST, a)
# else
# define DEBUG_S(a)
want_vtbl_collxfrm,
want_vtbl_amagic,
want_vtbl_amagicelem,
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
want_vtbl_mutex,
#endif
want_vtbl_regdata,
*/
struct interpreter {
-# ifndef USE_THREADS
+# ifndef USE_5005THREADS
# include "thrdvar.h"
# endif
# include "intrpvar.h"
};
#endif /* MULTIPLICITY || PERL_OBJECT */
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
/* If we have threads define a struct with all the variables
* that have to be per-thread
*/
#if !defined(MULTIPLICITY) && !defined(PERL_OBJECT)
START_EXTERN_C
# include "intrpvar.h"
-# ifndef USE_THREADS
+# ifndef USE_5005THREADS
# include "thrdvar.h"
# endif
END_EXTERN_C
EXT MGVTBL PL_vtbl_uvar = {MEMBER_TO_FPTR(Perl_magic_getuvar),
MEMBER_TO_FPTR(Perl_magic_setuvar),
0, 0, 0};
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
EXT MGVTBL PL_vtbl_mutex = {0, 0, 0, 0, MEMBER_TO_FPTR(Perl_magic_mutexfree)};
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
EXT MGVTBL PL_vtbl_defelem = {MEMBER_TO_FPTR(Perl_magic_getdefelem),MEMBER_TO_FPTR(Perl_magic_setdefelem),
0, 0, 0};
EXT MGVTBL PL_vtbl_uvar;
EXT MGVTBL PL_vtbl_ovrld;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
EXT MGVTBL PL_vtbl_mutex;
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
EXT MGVTBL PL_vtbl_defelem;
EXT MGVTBL PL_vtbl_regexp;
return ((CPerlObj*)pPerl)->Perl_my_chsize(fd, length);
}
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#undef Perl_condpair_magic
MAGIC*
{
return ((CPerlObj*)pPerl)->Perl_fbm_instr(big, bigend, littlesv, flags);
}
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#endif
#undef Perl_form
{
return ((CPerlObj*)pPerl)->Perl_grok_numeric_radix(sp, send);
}
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#endif
#if defined(USE_LOCALE_COLLATE)
#endif
return ((CPerlObj*)pPerl)->Perl_parse(xsinit, argc, argv, env);
}
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#undef Perl_new_struct_thread
struct perl_thread*
return ((CPerlObj*)pPerl)->Perl_unlnk(f);
}
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#undef Perl_unlock_condpair
void
{
return ((CPerlObj*)pPerl)->Perl_runops_debug();
}
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
#undef Perl_sv_lock
SV*
# endif
#if defined(PERL_FLEXIBLE_EXCEPTIONS)
#endif
-# if defined(USE_THREADS)
+# if defined(USE_5005THREADS)
# endif
#endif
#if defined(PERL_IN_PP_C) || defined(PERL_DECL_PROT)
/* currently running interpreter
* (initial parent interpreter under
* useithreads) */
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
PERLVAR(Gthr_key, perl_key) /* key to retrieve per-thread struct */
#endif
/* XXX does anyone even use this? */
PERLVARI(Gdo_undump, bool, FALSE) /* -u or dump seen? */
-#if defined(MYMALLOC) && (defined(USE_THREADS) || defined(USE_ITHREADS))
+#if defined(MYMALLOC) && (defined(USE_5005THREADS) || defined(USE_ITHREADS))
PERLVAR(Gmalloc_mutex, perl_mutex) /* Mutex for malloc */
#endif
interpreter.
Three macros control the major Perl build flavors: MULTIPLICITY,
-USE_THREADS and PERL_OBJECT. The MULTIPLICITY build has a C structure
+USE_5005THREADS and PERL_OBJECT. The MULTIPLICITY build has a C structure
that packages all the interpreter state, there is a similar thread-specific
-data structure under USE_THREADS, and the (now deprecated) PERL_OBJECT
+data structure under USE_5005THREADS, and the (now deprecated) PERL_OBJECT
build has a C++ class to maintain interpreter state. In all three cases,
PERL_IMPLICIT_CONTEXT is also normally defined, and enables the
support for passing in a "hidden" first argument that represents all three
# see objXSUB.h
Under PERL_OBJECT in extensions (aka PERL_CAPI), or under
-MULTIPLICITY/USE_THREADS with PERL_IMPLICIT_CONTEXT in both core
+MULTIPLICITY/USE_5005THREADS with PERL_IMPLICIT_CONTEXT in both core
and extensions, it will become:
Perl_sv_setsv(aTHX_ foo, bar); # the canonical Perl "API"
there plans to allow the interpreter to bundle up everything it knows
about the environment it's running on. This is enabled with the
PERL_IMPLICIT_SYS macro. Currently it only works with PERL_OBJECT
-and USE_THREADS on Windows (see inside iperlsys.h).
+and USE_5005THREADS on Windows (see inside iperlsys.h).
This allows the ability to provide an extra pointer (called the "host"
environment) for all the system calls. This makes it possible for
#endif
}
else if (gimme != G_ARRAY)
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
ary = (AV*)PL_curpad[0];
#else
ary = GvAVn(PL_defgv);
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
else
ary = Nullav;
if (ary && (gimme != G_ARRAY || (pm->op_pmflags & PMf_ONCE))) {
RETPUSHUNDEF;
}
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
void
Perl_unlock_condpair(pTHX_ void *svv)
{
PTR2UV(thr), PTR2UV(svv)));
MUTEX_UNLOCK(MgMUTEXP(mg));
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
PP(pp_lock)
{
dSP;
dTOPss;
SV *retsv = sv;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
sv_lock(sv);
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#ifdef USE_ITHREADS
shared_sv *ssv = Perl_sharedsv_find(aTHX_ sv);
if(ssv)
PP(pp_threadsv)
{
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
dSP;
EXTEND(SP, 1);
if (PL_op->op_private & OPpLVAL_INTRO)
RETURN;
#else
DIE(aTHX_ "tried to access per-thread data in non-threaded perl");
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
}
*
*/
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
#define ARGS thr
#define dARGS struct perl_thread *thr;
#else
#define ARGS
#define dARGS
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#define PP(s) OP * Perl_##s(pTHX)
tmpstr = POPs;
/* prevent recompiling under /o and ithreads. */
-#if defined(USE_ITHREADS) || defined(USE_THREADS)
+#if defined(USE_ITHREADS) || defined(USE_5005THREADS)
if (pm->op_pmflags & PMf_KEEP && PM_GETRE(pm))
RETURN;
#endif
/* XXX runtime compiled output needs to move to the pad */
if (pm->op_pmflags & PMf_KEEP) {
pm->op_private &= ~OPpRUNTIME; /* no point compiling again */
-#if !defined(USE_ITHREADS) && !defined(USE_THREADS)
+#if !defined(USE_ITHREADS) && !defined(USE_5005THREADS)
/* XXX can't change the optree at runtime either */
cLOGOP->op_first->op_next = PL_op->op_next;
#endif
ENTER; /* enter outer scope */
SAVETMPS;
- /* SAVE_DEFSV does *not* suffice here for USE_THREADS */
+ /* SAVE_DEFSV does *not* suffice here for USE_5005THREADS */
SAVESPTR(DEFSV);
ENTER; /* enter inner scope */
SAVEVPTR(PL_curpm);
PL_secondgv = gv_fetchpv("b", TRUE, SVt_PV);
PL_sortstash = stash;
}
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
sv_lock((SV *)PL_firstgv);
sv_lock((SV *)PL_secondgv);
#endif
/* This is mostly copied from pp_entersub */
AV *av = (AV*)PL_curpad[0];
-#ifndef USE_THREADS
+#ifndef USE_5005THREADS
cx->blk_sub.savearray = GvAV(PL_defgv);
GvAV(PL_defgv) = (AV*)SvREFCNT_inc(av);
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
cx->blk_sub.oldcurpad = PL_curpad;
cx->blk_sub.argarray = av;
}
ENTER;
SAVETMPS;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
if (PL_op->op_flags & OPf_SPECIAL) {
svp = &THREADSV(PL_op->op_targ); /* per-thread variable */
SAVEGENERICSV(*svp);
*svp = NEWSV(0,0);
}
else
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
if (PL_op->op_targ) {
#ifndef USE_ITHREADS
svp = &PL_curpad[PL_op->op_targ]; /* "my" variable */
EXTEND(PL_stack_sp, items); /* @_ could have been extended. */
Copy(AvARRAY(av), PL_stack_sp, items, SV*);
PL_stack_sp += items;
-#ifndef USE_THREADS
+#ifndef USE_5005THREADS
SvREFCNT_dec(GvAV(PL_defgv));
GvAV(PL_defgv) = cx->blk_sub.savearray;
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
/* abandon @_ if it got reified */
if (AvREAL(av)) {
(void)sv_2mortal((SV*)av); /* delay until return */
}
else if (CvXSUB(cv)) { /* put GvAV(defgv) back onto stack */
AV* av;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
av = (AV*)PL_curpad[0];
#else
av = GvAV(PL_defgv);
svp = AvARRAY(padlist);
}
}
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
if (!cx->blk_sub.hasargs) {
AV* av = (AV*)PL_curpad[0];
PUTBACK ;
}
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
SAVEVPTR(PL_curpad);
PL_curpad = AvARRAY((AV*)svp[CvDEPTH(cv)]);
-#ifndef USE_THREADS
+#ifndef USE_5005THREADS
if (cx->blk_sub.hasargs)
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
{
AV* av = (AV*)PL_curpad[0];
SV** ary;
-#ifndef USE_THREADS
+#ifndef USE_5005THREADS
cx->blk_sub.savearray = GvAV(PL_defgv);
GvAV(PL_defgv) = (AV*)SvREFCNT_inc(av);
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
cx->blk_sub.oldcurpad = PL_curpad;
cx->blk_sub.argarray = av;
++mark;
return rop;
}
-/* With USE_THREADS, eval_owner must be held on entry to doeval */
+/* With USE_5005THREADS, eval_owner must be held on entry to doeval */
STATIC OP *
S_doeval(pTHX_ int gimme, OP** startop)
{
assert(CxTYPE(&cxstack[cxstack_ix]) == CXt_EVAL);
cxstack[cxstack_ix].blk_eval.cv = PL_compcv;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
CvOWNER(PL_compcv) = 0;
New(666, CvMUTEXP(PL_compcv), 1, perl_mutex);
MUTEX_INIT(CvMUTEXP(PL_compcv));
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
PL_comppad = newAV();
av_push(PL_comppad, Nullsv);
PL_comppad_name_fill = 0;
PL_min_intro_pending = 0;
PL_padix = 0;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
av_store(PL_comppad_name, 0, newSVpvn("@_", 2));
PL_curpad[0] = (SV*)newAV();
SvPADMY_on(PL_curpad[0]); /* XXX Needed? */
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
comppadlist = newAV();
AvREAL_off(comppadlist);
}
SvREFCNT_dec(PL_rs);
PL_rs = SvREFCNT_inc(PL_nrs);
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
MUTEX_LOCK(&PL_eval_mutex);
PL_eval_owner = 0;
COND_SIGNAL(&PL_eval_cond);
MUTEX_UNLOCK(&PL_eval_mutex);
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
RETPUSHUNDEF;
}
SvREFCNT_dec(PL_rs);
SP = PL_stack_base + POPMARK; /* pop original mark */
PL_op = saveop; /* The caller may need it. */
PL_lex_state = LEX_NOTPARSING; /* $^S needs this. */
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
MUTEX_LOCK(&PL_eval_mutex);
PL_eval_owner = 0;
COND_SIGNAL(&PL_eval_cond);
MUTEX_UNLOCK(&PL_eval_mutex);
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
RETURNOP(PL_eval_start);
}
CopLINE_set(&PL_compiling, 0);
PUTBACK;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
MUTEX_LOCK(&PL_eval_mutex);
if (PL_eval_owner && PL_eval_owner != thr)
while (PL_eval_owner)
COND_WAIT(&PL_eval_cond, &PL_eval_mutex);
PL_eval_owner = thr;
MUTEX_UNLOCK(&PL_eval_mutex);
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
return DOCATCH(doeval(gimme, NULL));
}
if (PERLDB_LINE && PL_curstash != PL_debstash)
save_lines(CopFILEAV(&PL_compiling), PL_linestr);
PUTBACK;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
MUTEX_LOCK(&PL_eval_mutex);
if (PL_eval_owner && PL_eval_owner != thr)
while (PL_eval_owner)
COND_WAIT(&PL_eval_cond, &PL_eval_mutex);
PL_eval_owner = thr;
MUTEX_UNLOCK(&PL_eval_mutex);
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
ret = doeval(gimme, NULL);
if (PERLDB_INTER && was != PL_sub_generation /* Some subs defined here. */
&& ret != PL_op->op_next) { /* Successive compilation. */
I32 result;
AV *av;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
av = (AV*)PL_curpad[0];
#else
av = GvAV(PL_defgv);
/* Hot code. */
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
static void unset_cvowner(pTHXo_ void *cvarg);
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
PP(pp_const)
{
STRLEN maxlen;
char *max = SvPV((SV*)av, maxlen);
if (!SvNIOK(cur) && SvCUR(cur) <= maxlen) {
-#ifndef USE_THREADS /* don't risk potential race */
+#ifndef USE_5005THREADS /* don't risk potential race */
if (SvREFCNT(*itersvp) == 1 && !SvMAGICAL(*itersvp)) {
/* safe to reuse old SV */
sv_setsv(*itersvp, cur);
if (cx->blk_loop.iterix > cx->blk_loop.itermax)
RETPUSHNO;
-#ifndef USE_THREADS /* don't risk potential race */
+#ifndef USE_5005THREADS /* don't risk potential race */
if (SvREFCNT(*itersvp) == 1 && !SvMAGICAL(*itersvp)) {
/* safe to reuse old SV */
sv_setiv(*itersvp, cx->blk_loop.iterix++);
DIE(aTHX_ "No DBsub routine");
}
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
/*
* First we need to check if the sub or method requires locking.
* If so, we gain a lock on the CV, the first argument or the
SAVEDESTRUCTOR_X(unset_cvowner, (void*) cv);
}
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
if (CvXSUB(cv)) {
#ifdef PERL_XSUB_OLDSTYLE
* back. This would allow popping @_ in XSUB, e.g.. XXXX */
AV* av;
I32 items;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
av = (AV*)PL_curpad[0];
#else
av = GvAV(PL_defgv);
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
items = AvFILLp(av) + 1; /* @_ is not tieable */
if (items) {
svp = AvARRAY(padlist);
}
}
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
if (!hasargs) {
AV* av = (AV*)PL_curpad[0];
PUTBACK ;
}
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
SAVEVPTR(PL_curpad);
PL_curpad = AvARRAY((AV*)svp[CvDEPTH(cv)]);
-#ifndef USE_THREADS
+#ifndef USE_5005THREADS
if (hasargs)
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
{
AV* av;
SV** ary;
AvREAL_off(av);
AvREIFY_on(av);
}
-#ifndef USE_THREADS
+#ifndef USE_5005THREADS
cx->blk_sub.savearray = GvAV(PL_defgv);
GvAV(PL_defgv) = (AV*)SvREFCNT_inc(av);
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
cx->blk_sub.oldcurpad = PL_curpad;
cx->blk_sub.argarray = av;
++MARK;
return isGV(gv) ? (SV*)GvCV(gv) : (SV*)gv;
}
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
static void
unset_cvowner(pTHXo_ void *cvarg)
{
MUTEX_UNLOCK(CvMUTEXP(cv));
SvREFCNT_dec(cv);
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE) && defined(F_FREESP)
PERL_CALLCONV I32 Perl_my_chsize(pTHX_ int fd, Off_t length);
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
PERL_CALLCONV MAGIC* Perl_condpair_magic(pTHX_ SV *sv);
#endif
PERL_CALLCONV OP* Perl_convert(pTHX_ I32 optype, I32 flags, OP* o);
PERL_CALLCONV void Perl_fbm_compile(pTHX_ SV* sv, U32 flags);
PERL_CALLCONV char* Perl_fbm_instr(pTHX_ unsigned char* big, unsigned char* bigend, SV* littlesv, U32 flags);
PERL_CALLCONV char* Perl_find_script(pTHX_ char *scriptname, bool dosearch, char **search_ext, I32 flags);
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
PERL_CALLCONV PADOFFSET Perl_find_threadsv(pTHX_ const char *name);
#endif
PERL_CALLCONV OP* Perl_force_list(pTHX_ OP* arg);
PERL_CALLCONV int Perl_magic_getuvar(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV int Perl_magic_getvec(pTHX_ SV* sv, MAGIC* mg);
PERL_CALLCONV U32 Perl_magic_len(pTHX_ SV* sv, MAGIC* mg);
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
PERL_CALLCONV int Perl_magic_mutexfree(pTHX_ SV* sv, MAGIC* mg);
#endif
PERL_CALLCONV int Perl_magic_nextpack(pTHX_ SV* sv, MAGIC* mg, SV* key);
PERL_CALLCONV int Perl_run(pTHX);
PERL_CALLCONV int Perl_parse(pTHX_ XSINIT_t xsinit, int argc, char** argv, char** env);
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
PERL_CALLCONV struct perl_thread* Perl_new_struct_thread(pTHX_ struct perl_thread *t);
#endif
PERL_CALLCONV void Perl_call_atexit(pTHX_ ATEXIT_t fn, void *ptr);
#if defined(UNLINK_ALL_VERSIONS)
PERL_CALLCONV I32 Perl_unlnk(pTHX_ char* f);
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
PERL_CALLCONV void Perl_unlock_condpair(pTHX_ void* svv);
#endif
PERL_CALLCONV void Perl_unsharepvn(pTHX_ const char* sv, I32 len, U32 hash);
#endif
PERL_CALLCONV int Perl_runops_standard(pTHX);
PERL_CALLCONV int Perl_runops_debug(pTHX);
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
PERL_CALLCONV SV* Perl_sv_lock(pTHX_ SV *sv);
#endif
PERL_CALLCONV void Perl_sv_catpvf_mg(pTHX_ SV *sv, const char* pat, ...)
STATIC void* S_vcall_body(pTHX_ va_list args);
STATIC void* S_vcall_list_body(pTHX_ va_list args);
#endif
-# if defined(USE_THREADS)
+# if defined(USE_5005THREADS)
STATIC struct perl_thread * S_init_main_thread(pTHX);
# endif
#endif
if (PL_reg_sv) {
/* Make $_ available to executed code. */
if (PL_reg_sv != DEFSV) {
- /* SAVE_DEFSV does *not* suffice here for USE_THREADS */
+ /* SAVE_DEFSV does *not* suffice here for USE_5005THREADS */
SAVESPTR(DEFSV);
DEFSV = PL_reg_sv;
}
SV**
Perl_stack_grow(pTHX_ SV **sp, SV **p, int n)
{
-#if defined(DEBUGGING) && !defined(USE_THREADS)
+#if defined(DEBUGGING) && !defined(USE_5005THREADS)
static int growing = 0;
if (growing++)
abort();
#else
av_extend(PL_curstack, (p - PL_stack_base) + (n) + 1);
#endif
-#if defined(DEBUGGING) && !defined(USE_THREADS)
+#if defined(DEBUGGING) && !defined(USE_5005THREADS)
growing--;
#endif
return PL_stack_sp;
SV **
Perl_save_threadsv(pTHX_ PADOFFSET i)
{
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
SV **svp = &THREADSV(i); /* XXX Change to save by offset */
DEBUG_S(PerlIO_printf(Perl_debug_log, "save_threadsv %"UVuf": %p %p:%s\n",
(UV)i, svp, *svp, SvPEEK(*svp)));
#else
Perl_croak(aTHX_ "panic: save_threadsv called in non-threaded perl");
return 0;
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
}
void
case PERL_MAGIC_dbline:
mg->mg_virtual = &PL_vtbl_dbline;
break;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
case PERL_MAGIC_mutex:
mg->mg_virtual = &PL_vtbl_mutex;
break;
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#ifdef USE_LOCALE_COLLATE
case PERL_MAGIC_collxfrm:
mg->mg_virtual = &PL_vtbl_collxfrm;
#if defined(USE_ITHREADS)
-#if defined(USE_THREADS)
-# include "error: USE_THREADS and USE_ITHREADS are incompatible"
+#if defined(USE_5005THREADS)
+# include "error: USE_5005THREADS and USE_ITHREADS are incompatible"
#endif
#ifndef GpREFCNT_inc
#define SvFLAGS(sv) (sv)->sv_flags
#define SvREFCNT(sv) (sv)->sv_refcnt
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
# if defined(VMS)
# define ATOMIC_INC(count) __ATOMIC_INCREMENT_LONG(&count)
#else
# define ATOMIC_INC(count) (++count)
# define ATOMIC_DEC_AND_TEST(res, count) (res = (--count == 0))
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#ifdef __GNUC__
# define SvREFCNT_inc(sv) \
nsv; \
})
#else
-# if defined(CRIPPLED_CC) || defined(USE_THREADS)
+# if defined(CRIPPLED_CC) || defined(USE_5005THREADS)
# if defined(VMS) && defined(__ALPHA)
# define SvREFCNT_inc(sv) \
(PL_Sv=(SV*)(sv), (PL_Sv && __ATOMIC_INCREMENT_LONG(&(SvREFCNT(PL_Sv)))), (SV *)PL_Sv)
long xcv_depth; /* >= 2 indicates recursive call */
AV * xcv_padlist;
CV * xcv_outside;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
perl_mutex *xcv_mutexp; /* protects xcv_owner */
struct perl_thread *xcv_owner; /* current owner thread */
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
cv_flags_t xcv_flags;
I32 xfm_lines;
: sv_2bool(sv) )
# define SvTRUEx(sv) ({SV *nsv = (sv); SvTRUE(nsv); })
#else /* __GNUC__ */
-#ifndef USE_THREADS
+#ifndef USE_5005THREADS
/* These inlined macros use globals, which will require a thread
* declaration in user code, so we avoid them under threads */
? SvNVX(sv) != 0.0 \
: sv_2bool(sv) )
# define SvTRUEx(sv) ((PL_Sv = (sv)), SvTRUE(PL_Sv))
-#endif /* !USE_THREADS */
+#endif /* !USE_5005THREADS */
#endif /* !__GNU__ */
#endif /* !CRIPPLED_CC */
/* Don't forget to re-run embed.pl to propagate changes! */
/* The 'T' prefix is only needed for vars that need appropriate #defines
- * generated when built with or without USE_THREADS. It is also used
+ * generated when built with or without USE_5005THREADS. It is also used
* to generate the appropriate export list for win32.
*
- * When building without USE_THREADS, these variables will be truly global.
- * When building without USE_THREADS but with MULTIPLICITY, these variables
+ * When building without USE_5005THREADS, these variables will be truly global.
+ * When building without USE_5005THREADS but with MULTIPLICITY, these variables
* will be global per-interpreter. */
/* Important ones in the first cache line (if alignment is done right) */
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
PERLVAR(interp, PerlInterpreter*) /* thread owner */
#endif
/* Note that the variables below are all explicitly referenced in the code
* as thr->whatever and therefore don't need the 'T' prefix. */
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
PERLVAR(oursv, SV *)
PERLVAR(cvcache, HV *)
PERLVAR(trailing_nul, char) /* For the sake of thrsv and oursv */
PERLVAR(thr_done, bool) /* True when the thread has finished */
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
PERLVAR(Treg_sv_utf8, bool) /* was what we matched against utf8 */
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
#if defined(VMS)
#include <builtins.h>
# define THREAD_RET_CAST(p) ((void *)(p))
#endif /* THREAD_RET */
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
/* Accessor for per-thread SVs */
# define THREADSV(i) (thr->threadsvp[i])
#define MgCONDP(mg) (&((condpair_t *)(mg->mg_ptr))->cond)
#define MgOWNER(mg) ((condpair_t *)(mg->mg_ptr))->owner
-#endif /* USE_THREADS */
-#endif /* USE_THREADS || USE_ITHREADS */
+#endif /* USE_5005THREADS */
+#endif /* USE_5005THREADS || USE_ITHREADS */
#ifndef MUTEX_LOCK
# define MUTEX_LOCK(m)
if (PL_lex_dojoin) {
PL_nextval[PL_nexttoke].ival = 0;
force_next(',');
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
PL_nextval[PL_nexttoke].opval = newOP(OP_THREADSV, 0);
PL_nextval[PL_nexttoke].opval->op_targ = find_threadsv("\"");
force_next(PRIVATEREF);
#else
force_ident("\"", '$');
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
PL_nextval[PL_nexttoke].ival = 0;
force_next('$');
PL_nextval[PL_nexttoke].ival = 0;
*/
if (!strchr(PL_tokenbuf,':')) {
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
/* Check for single character per-thread SVs */
if (PL_tokenbuf[0] == '$' && PL_tokenbuf[2] == '\0'
&& !isALPHA(PL_tokenbuf[1]) /* Rule out obvious non-threadsvs */
yylval.opval->op_targ = tmp;
return PRIVATEREF;
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
if ((tmp = pad_findmy(PL_tokenbuf)) != NOT_IN_PAD) {
SV *namesv = AvARRAY(PL_comppad_name)[tmp];
/* might be an "our" variable" */
PL_min_intro_pending = 0;
PL_padix = 0;
PL_subline = CopLINE(PL_curcop);
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
av_store(PL_comppad_name, 0, newSVpvn("@_", 2));
PL_curpad[0] = (SV*)newAV();
SvPADMY_on(PL_curpad[0]); /* XXX Needed? */
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
comppadlist = newAV();
AvREAL_off(comppadlist);
CvPADLIST(PL_compcv) = comppadlist;
CvOUTSIDE(PL_compcv) = (CV*)SvREFCNT_inc(outsidecv);
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
CvOWNER(PL_compcv) = 0;
New(666, CvMUTEXP(PL_compcv), 1, perl_mutex);
MUTEX_INIT(CvMUTEXP(PL_compcv));
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
return oldsavestack_ix;
}
/*#define USE_5005THREADS / **/
/*#define USE_ITHREADS / **/
#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
-#define USE_THREADS /* until src is revised*/
+#define USE_5005THREADS /* until src is revised*/
#endif
/*#define OLD_PTHREADS_API / **/
/*#define USE_REENTRANT_API / **/
line_mode ? "line" : "chunk",
(IV)IoLINES(GvIOp(PL_last_in_gv)));
}
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
if (thr->tid)
Perl_sv_catpvf(aTHX_ sv, " thread %ld", thr->tid);
#endif
message = SvPV(msv, msglen);
if (ckDEAD(err)) {
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
DEBUG_S(PerlIO_printf(Perl_debug_log, "croak: 0x%"UVxf" %s", PTR2UV(thr), message));
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
if (PL_diehook) {
/* sv_2cv might call Perl_croak() */
SV *olddiehook = PL_diehook;
void
Perl_atfork_lock(void)
{
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
/* locks must be held in locking order (if any) */
# ifdef MYMALLOC
MUTEX_LOCK(&PL_malloc_mutex);
void
Perl_atfork_unlock(void)
{
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
/* locks must be released in same order as in atfork_lock() */
# ifdef MYMALLOC
MUTEX_UNLOCK(&PL_malloc_mutex);
{
#if defined(HAS_FORK)
Pid_t pid;
-#if (defined(USE_THREADS) || defined(USE_ITHREADS)) && !defined(HAS_PTHREAD_ATFORK)
+#if (defined(USE_5005THREADS) || defined(USE_ITHREADS)) && !defined(HAS_PTHREAD_ATFORK)
atfork_lock();
pid = fork();
atfork_unlock();
void *
Perl_get_context(void)
{
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
# ifdef OLD_PTHREADS_API
pthread_addr_t t;
if (pthread_getspecific(PL_thr_key, &t))
void
Perl_set_context(void *t)
{
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
# ifdef I_MACH_CTHREADS
cthread_set_data(cthread_self(), t);
# else
#endif /* !PERL_GET_CONTEXT_DEFINED */
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
#ifdef FAKE_THREADS
/* Very simplistic scheduler for now */
#endif /* HAVE_THREAD_INTERN */
return thr;
}
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#ifdef PERL_GLOBAL_STRUCT
struct perl_vars *
case want_vtbl_uvar:
result = &PL_vtbl_uvar;
break;
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
case want_vtbl_mutex:
result = &PL_vtbl_mutex;
break;
$optimize = $qual;
$ccflags =~ s/$qual//;
}
- $usethreads = ($ccflags =~ m!/DEF[^/]+USE_THREADS!i and
- $ccflags !~ m!/UND[^/]+USE_THREADS!i);
+ $usethreads = ($ccflags =~ m!/DEF[^/]+USE_5005THREADS!i and
+ $ccflags !~ m!/UND[^/]+USE_5005THREADS!i);
print OUT "usethreads='",($usethreads ? 'define' : 'undef'),"'\n";;
$optimize = "$debug$optimize";
print OUT "ccflags='$ccflags'\n";
# as the manifest for the obsolete variable $d_eunice.
print OUT "d_eunice='undef'\n"; delete $pp_vars{VMS};
-# XXX temporary -- USE_THREADS is currently on CC command line
-delete $pp_vars{'USE_THREADS'};
+# XXX temporary -- USE_5005THREADS is currently on CC command line
+delete $pp_vars{'USE_5005THREADS'};
foreach (sort keys %pp_vars) {
warn "Didn't see $_ in $infile\n";
/* fully initialized, in which case either thr or PL_curcop */
/* might be bogus. We have to check, since ckWARN needs them */
/* both to be valid if running threaded */
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
if (thr && PL_curcop) {
#endif
if (ckWARN(WARN_MISC)) {
Perl_warner(aTHX_ WARN_MISC,"Value of CLI symbol \"%s\" too long",lnm);
}
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
} else {
Perl_warner(aTHX_ WARN_MISC,"Value of CLI symbol \"%s\" too long",lnm);
}
#if defined(PERL_IMPLICIT_CONTEXT)
pTHX;
#endif
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
static perl_mutex primenv_mutex;
MUTEX_INIT(&primenv_mutex);
#endif
if (tabidx) { tabvec[tabidx] = NULL; env_tables = tabvec; }
getredirection(argcp,argvp);
-#if defined(USE_THREADS) && ( defined(__DECC) || defined(__DECCXX) )
+#if defined(USE_5005THREADS) && ( defined(__DECC) || defined(__DECCXX) )
{
# include <reentrancy.h>
(void) decc$set_reentrancy(C$C_MULTITHREAD);
/*#define USE_5005THREADS /**/
/*#define USE_ITHREADS /**/
#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
-#define USE_THREADS /* until src is revised*/
+#define USE_5005THREADS /* until src is revised*/
#endif
/*#define OLD_PTHREADS_API /**/
/*#define USE_REENTRANT_API /**/
/*#define USE_5005THREADS /**/
/*#define USE_ITHREADS /**/
#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
-#define USE_THREADS /* until src is revised*/
+#define USE_5005THREADS /* until src is revised*/
#endif
/*#define OLD_PTHREADS_API /**/
/*#define USE_REENTRANT_API /**/
/*#define USE_5005THREADS /**/
#define USE_ITHREADS /**/
#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
-#define USE_THREADS /* until src is revised*/
+#define USE_5005THREADS /* until src is revised*/
#endif
/*#define OLD_PTHREADS_API /**/
/*#define USE_REENTRANT_API /**/
/*#define USE_5005THREADS /**/
#define USE_ITHREADS /**/
#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
-#define USE_THREADS /* until src is revised*/
+#define USE_5005THREADS /* until src is revised*/
#endif
/*#define OLD_PTHREADS_API /**/
/*#define USE_REENTRANT_API /**/
/*#define USE_5005THREADS /**/
#define USE_ITHREADS /**/
#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
-#define USE_THREADS /* until src is revised*/
+#define USE_5005THREADS /* until src is revised*/
#endif
/*#define OLD_PTHREADS_API /**/
/*#define USE_REENTRANT_API /**/
PerlIO_cleanup() was done here but fails (B).
*/
EndSockets();
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
if (PL_curinterp)
FREE_THREAD_KEY;
#endif
# endif
};
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
# ifndef USE_DECLSPEC_THREAD
# define HAVE_THREAD_INTERN
# endif /* !USE_DECLSPEC_THREAD */
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#define HAVE_INTERP_INTERN
typedef struct {
child_tab * pseudo_children;
#endif
void * internal_host;
-#ifndef USE_THREADS
+#ifndef USE_5005THREADS
struct thread_intern thr_intern;
#endif
};
#define w32_pseudo_child_pids (w32_pseudo_children->pids)
#define w32_pseudo_child_handles (w32_pseudo_children->handles)
#define w32_internal_host (PL_sys_intern.internal_host)
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
# define w32_strerror_buffer (thr->i.Wstrerror_buffer)
# define w32_getlogin_buffer (thr->i.Wgetlogin_buffer)
# define w32_crypt_buffer (thr->i.Wcrypt_buffer)
# define w32_crypt_buffer (PL_sys_intern.thr_intern.Wcrypt_buffer)
# define w32_servent (PL_sys_intern.thr_intern.Wservent)
# define w32_init_socktype (PL_sys_intern.thr_intern.Winit_socktype)
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
/* UNICODE<>ANSI translation helpers */
/* Use CP_ACP when mode is ANSI */
# define TO_SOCKET(x) (x)
#endif /* USE_SOCKETS_AS_HANDLES */
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
#define StartSockets() \
STMT_START { \
if (!wsock_started) \
set_socktype(void)
{
#ifdef USE_SOCKETS_AS_HANDLES
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
dTHXo;
if (!w32_init_socktype) {
#endif
*/
setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE,
(char *)&iSockOpt, sizeof(iSockOpt));
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
w32_init_socktype = 1;
}
#endif
void
Perl_set_context(void *t)
{
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
# ifdef USE_DECLSPEC_THREAD
Perl_current_context = t;
# else
void *
Perl_get_context(void)
{
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
# ifdef USE_DECLSPEC_THREAD
return Perl_current_context;
# else
#endif
}
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
void
Perl_init_thread_intern(struct perl_thread *athr)
{
#define PERL_SET_CONTEXT(t) Perl_set_context(t)
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
struct perl_thread;
int Perl_thread_create (struct perl_thread *thr, thread_func_t *fn);
void Perl_set_thread_self (struct perl_thread *thr);
#define SET_THREAD_SELF(thr) Perl_set_thread_self(thr)
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
END_EXTERN_C
/*#define USE_5005THREADS /**/
/*#define USE_ITHREADS /**/
#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
-#define USE_THREADS /* until src is revised*/
+#define USE_5005THREADS /* until src is revised*/
#endif
/*#define OLD_PTHREADS_API /**/
/*#define USE_REENTRANT_API /**/
/*#define USE_5005THREADS /**/
/*#define USE_ITHREADS /**/
#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
-#define USE_THREADS /* until src is revised*/
+#define USE_5005THREADS /* until src is revised*/
#endif
/*#define OLD_PTHREADS_API /**/
# endif
};
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
# ifndef USE_DECLSPEC_THREAD
# define HAVE_THREAD_INTERN
# endif /* !USE_DECLSPEC_THREAD */
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
#define HAVE_INTERP_INTERN
typedef struct {
child_tab * pseudo_children;
#endif
void * internal_host;
-#ifndef USE_THREADS
+#ifndef USE_5005THREADS
struct thread_intern thr_intern;
#endif
};
#define w32_pseudo_child_pids (w32_pseudo_children->pids)
#define w32_pseudo_child_handles (w32_pseudo_children->handles)
#define w32_internal_host (PL_sys_intern.internal_host)
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
# define w32_strerror_buffer (thr->i.Wstrerror_buffer)
# define w32_getlogin_buffer (thr->i.Wgetlogin_buffer)
# define w32_crypt_buffer (thr->i.Wcrypt_buffer)
# define w32_crypt_buffer (PL_sys_intern.thr_intern.Wcrypt_buffer)
# define w32_servent (PL_sys_intern.thr_intern.Wservent)
# define w32_init_socktype (PL_sys_intern.thr_intern.Winit_socktype)
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
/* UNICODE<>ANSI translation helpers */
/* Use CP_ACP when mode is ANSI */
void
Perl_set_context(void *t)
{
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
# ifdef USE_DECLSPEC_THREAD
Perl_current_context = t;
# else
void *
Perl_get_context(void)
{
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
# ifdef USE_DECLSPEC_THREAD
return Perl_current_context;
# else
#endif
}
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
void
Perl_init_thread_intern(struct perl_thread *athr)
{
#define PERL_SET_CONTEXT(t) Perl_set_context(t)
#endif
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
struct perl_thread;
int Perl_thread_create (struct perl_thread *thr, thread_func_t *fn);
void Perl_set_thread_self (struct perl_thread *thr);
#define SET_THREAD_SELF(thr) Perl_set_thread_self(thr)
-#endif /* USE_THREADS */
+#endif /* USE_5005THREADS */
END_EXTERN_C
#define TO_SOCKET(X) (X)
-#ifdef USE_THREADS
+#ifdef USE_5005THREADS
#define StartSockets() \
STMT_START { \
if (!wsock_started) \