kraih/mojo — pull request #384 by kmx (2012-09-17 08:47:20+00:00)
Title: Workaround for morbo (MSWin + threads related)

Hi,

I was investigating why morbo's autoreloading feature is crashing on MS Windows.

It turns out that there are 2 pieces used by Mojo that do not play well with threads (you probably know that fork() which is used by morbo is emulated via threads on MS Windows).

1/ Mojo::Reactor::EV seems to have troubles when used with perl's threads

2/ IO::Socket::SSL is basically thread safe providing that it is loaded in the main thread - I have created an RT for this issue https://rt.cpan.org/Public/Bug/Display.html?id=79685

The patch in this pull request tries to deal with those 2 issues.

I know that it is a hack and that proper fix should be made in other modules outside Mojo. On the other hand providing that morbo is "only" development server I hope you will not reject it.

--
kmx