Skip to content

Commit

Permalink
HL didn't support threads in Haxe 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
player-03 authored Oct 21, 2024
1 parent 1871349 commit 4c987ef
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lime/system/BackgroundWorker.hx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class BackgroundWorker
public var onProgress = new Event<Dynamic->Void>();

@:noCompletion private var __runMessage:Dynamic;
#if (cpp || neko || hl)
#if (cpp || neko || (haxe4 && hl))
@:noCompletion private var __messageQueue:Deque<Dynamic>;
@:noCompletion private var __workerThread:Thread;
#end
Expand All @@ -87,7 +87,7 @@ class BackgroundWorker
{
canceled = true;

#if (cpp || neko || hl)
#if (cpp || neko || (haxe4 && hl))
__workerThread = null;
#end
}
Expand All @@ -102,7 +102,7 @@ class BackgroundWorker
completed = false;
__runMessage = message;

#if (cpp || neko || hl)
#if (cpp || neko || (haxe4 && hl))
__messageQueue = new Deque<Dynamic>();
__workerThread = Thread.create(__doWork);

Expand All @@ -125,7 +125,7 @@ class BackgroundWorker
{
completed = true;

#if (cpp || neko || hl)
#if (cpp || neko || (haxe4 && hl))
__messageQueue.add(MESSAGE_COMPLETE);
__messageQueue.add(message);
#else
Expand All @@ -143,7 +143,7 @@ class BackgroundWorker
**/
public function sendError(message:Dynamic = null):Void
{
#if (cpp || neko || hl)
#if (cpp || neko || (haxe4 && hl))
__messageQueue.add(MESSAGE_ERROR);
__messageQueue.add(message);
#else
Expand All @@ -161,7 +161,7 @@ class BackgroundWorker
**/
public function sendProgress(message:Dynamic = null):Void
{
#if (cpp || neko || hl)
#if (cpp || neko || (haxe4 && hl))
__messageQueue.add(message);
#else
if (!canceled)
Expand Down Expand Up @@ -193,7 +193,7 @@ class BackgroundWorker

@:noCompletion private function __update(deltaTime:Int):Void
{
#if (cpp || neko || hl)
#if (cpp || neko || (haxe4 && hl))
var message = __messageQueue.pop(false);

if (message != null)
Expand Down

1 comment on commit 4c987ef

@player-03
Copy link
Contributor Author

@player-03 player-03 commented on 4c987ef Oct 22, 2024

Choose a reason for hiding this comment

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

These conditions are getting pretty long, so maybe we want to switch to lime_threads at some point. Specifically, (lime_threads && !html5).

Please sign in to comment.