Commit Graph

43 Commits

Author SHA1 Message Date
a02955e929 Clean up the logic of a few methods in the ThreadPool singleton. 2021-10-31 12:31:15 +01:00
0aa6ec8700 Decrease the delay a bit in cancel_job_wait. 2021-10-31 12:12:48 +01:00
59ba27f161 Don't use the _queue.write if it's not needed. 2021-10-31 12:12:27 +01:00
c0a2d3bbe5 Removed ancient create_job methods. 2021-10-31 12:09:48 +01:00
3bf2cae157 Added a has_job getter to the ThreadPool singleton. 2021-10-31 12:06:00 +01:00
1ed776e266 Renamed cancel_task to cancel_job, and cancel_task_wait to cance_job_wait 2021-10-31 12:01:10 +01:00
aa7be7b43a Add 2 missing properties to ThreadPoolJob. 2021-10-31 11:59:18 +01:00
b2e8c81539 Update the copyright texts for 2021. 2021-04-19 10:14:06 +02:00
da4e049da0 Updated for the new 3.2 godot branch - Threading/Semaphore refactor - (f15f5b45781eb3de8e5811400f654e3e49580149). 2021-02-20 22:42:20 +01:00
72049428df Fix compile for 4.0. 2021-02-06 11:53:02 +01:00
bc0d2f6deb Fix race condition in ThreadPool. Also replaced _THREAD_SAFE_METHOD_-s to _THREAD_SAFE_LOCK_-s and _THREAD_SAFE_UNLOCK_-s in the same class. 2020-10-20 22:06:08 +02:00
b1030eaf92 Removed the copyright header from config.py, as utf-8 characters apparently can cause issues. 2020-08-08 20:03:49 +02:00
b4cda4e527 Now setting thread_count to 0 or less means get the processor count, and add it to it (it is negative). Also added a fallback thread count, in case it ends up being invalid. (Like get_porocessor_count returns something bogus, or you give it a too high number.) 2020-08-04 18:09:21 +02:00
a9d55cc1c4 Cleanup ThreadPoolExecuteJob's _execute. 2020-08-04 15:25:06 +02:00
862a366e9a execute() now properly resets the current run stage. 2020-08-04 15:24:12 +02:00
0297e4d86d should_so should return true at the end. 2020-08-04 15:15:49 +02:00
ff3224f7d0 Added reset_stages() to ThreadPoolJob. 2020-08-04 14:50:41 +02:00
bbfa838011 Comment. 2020-08-04 14:36:30 +02:00
db1d5d1d81 Remove limit execution time bool, as it's trivial to check for the same thing. 2020-08-04 10:45:32 +02:00
262cdb6638 Fix typo. 2020-08-04 10:39:11 +02:00
1473e2b5f1 Set start time in execute(). 2020-08-04 10:21:24 +02:00
164ad82feb Typo. 2020-07-28 15:23:05 +02:00
f640c40564 Tweaks. 2020-07-28 15:22:02 +02:00
97fc7132db More tweaks. 2020-07-28 15:20:56 +02:00
1a7c4e69a5 Proper Readme.md. 2020-07-28 15:13:59 +02:00
93320fe864 Add a completed signal to the jobs. 2020-06-22 02:32:02 +02:00
2808b32eba Sync classref with current source. 2020-06-20 23:34:03 +02:00
acc7759682 4.0 compile fix. 2020-06-20 22:36:49 +02:00
c2aa301896 Fix single threaded logic. 2020-05-30 20:19:43 +02:00
3891a9b68d Separated the job into ThreadPoolJob and ThreadPoolExecuteJob. This design makes everything more resilient to crashes, as it encourages writing encapsulated standalone job classes. The execute job can still be used to just run methods/functions in separate threads. 2020-05-30 16:20:53 +02:00
5093853b3f Small fixes. 2020-05-24 21:17:32 +02:00
d182f9a24f Also invert the logic. 2020-05-24 20:07:30 +02:00
967b21da87 Fix typo. 2020-05-24 20:00:49 +02:00
7046fa7b08 Invert the logic of the 2 control flow functions name. 2020-05-24 19:59:40 +02:00
c69a2a9db4 When not using threading just return the head of the queue in get_running_job. 2020-05-24 19:58:09 +02:00
61fffea0a4 Tasks can be cancelled now. 2020-05-24 19:52:27 +02:00
222e9fa6cd Now the module actually works. 2020-05-24 19:04:02 +02:00
ded9df9772 Setup the ThreadPool singleton's api itself. 2020-05-24 12:39:17 +02:00
0047fb6c4c Added ThreadPoolJob. 2020-05-24 11:51:05 +02:00
13f3c60a71 Fix copy paste error. 2020-05-24 11:50:55 +02:00
19b27c3da3 Setup the ThreadPool singleton. 2020-05-24 10:54:15 +02:00
f89e3c59aa Fix copy paste fail. 2020-05-24 10:46:49 +02:00
f772f49c87 Initial commit. 2020-05-24 10:42:29 +02:00