Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Thread.create issue with Haxe nightlies #188

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/massive/munit/TestRunner.hx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ class TestRunner implements IAsyncDelegateObserver

#if (neko || cpp || java || hl || eval)
var self = this;
var runThread:Thread = Thread.create(function()
var createThread = Thread.create;
#if (haxe4 && (haxe >= version("4.2.0-rc.1")))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not #if (haxe >= version("4.2.0-rc.1"))?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mb?

var createThread = #if (haxe >= version("4.2.0-rc.1")) Thread.createWithEventLoop #else Thread.create #end;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to break compatibility with Haxe 3, version("x.x.x") is a Haxe 4 feature

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that being said... I should have tested with Haxe 3, which makes a bit more ugly. I had to split the conditionals to make it work.

createThread = Thread.createWithEventLoop;
#end
var runThread:Thread = createThread(function()
{
self.execute();
while (self.running)
Expand Down