openfl / lime

A foundational Haxe framework for cross-platform development
https://lime.openfl.org/
MIT License
754 stars 370 forks source link

Allow a single `ThreadPool` to run jobs in both modes #1837

Open player-03 opened 1 month ago

player-03 commented 1 month ago

There are enough use cases for both types of job that it's likely some users will want to use both. Before this PR, this required creating two ThreadPools, one for each mode. Now, you only need the one.

If you call run() without passing the new mode argument, it falls back to the pool's mode, just like before.