Yes, it then crashes as soon as the 1st thread tries to malloc. Then, having cleared the popup, I get some more output indicating that the 2nd thread got as far as the malloc, too. But it never gets any further than that.
Re^2: [Win32] pthreads and memory allocation
Replies are listed 'Best First'.
I think that the problem is likely that malloc has been redefined by the Perl/XS headers and the Perl code that gets called is trying to access the perl thread context for the "current" thread. Which of course doesn't exist because the thread was not created by Perl.
Another thought. If you add #undef malloc just prior to your use of malloc, you may find that the code will run without immediately crashing. But I make no claim that you won't run into similar problems later on.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.