diff --git a/pod/perldelta.pod b/pod/perldelta.pod index baf1d278054a..875de427f34c 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -330,9 +330,10 @@ L section. =over 4 -=item XXX-some-platform +=item Win32 -XXX +Fix builds with C defined but C not +defined. =back diff --git a/win32/perllib.c b/win32/perllib.c index 1200a351bea9..efae2d817b8d 100644 --- a/win32/perllib.c +++ b/win32/perllib.c @@ -48,9 +48,17 @@ xs_init(pTHX) #include "perlhost.h" +#define PANIC_THREAD_ID_MSG "panic: thread id mismatch\n" + +#define panic_thread_id() \ + (void)WriteFile(GetStdHandle(STD_ERROR_HANDLE), \ + PANIC_THREAD_ID_MSG, sizeof(PANIC_THREAD_ID_MSG)-1, \ + NULL, NULL) + void win32_checkTLS(PerlInterpreter *host_perl) { +#ifdef USE_ITHREADS /* GCurThdId() is lightweight, but b/c of the ctrl-c/signals sometimes firing in other random WinOS threads, that make the TIDs go out of sync. This isn't always an error, although high chance of a SEGV in the next @@ -62,11 +70,20 @@ win32_checkTLS(PerlInterpreter *host_perl) if(tid != host_perl->Isys_intern.cur_tid) { dTHX; /* heavyweight */ if (host_perl != my_perl) { - int *nowhere = NULL; + panic_thread_id(); + DebugBreak(); abort(); } host_perl->Isys_intern.cur_tid = tid; } +#elif defined(PERL_MULTIPLICITY) + dTHX; + if (host_perl != my_perl) { + panic_thread_id(); + DebugBreak(); + abort(); + } +#endif } EXTERN_C void