From e1420e5e7d82efdd48353b8c6b04f75103cd4388 Mon Sep 17 00:00:00 2001 From: CIownxz Date: Sun, 23 Apr 2023 00:34:30 -0400 Subject: [PATCH] v1.0.0 Release Wally, Bump Rojo, Cleanup Code. --- .gitignore | 3 ++- aftman.toml | 4 ++-- default.project.json | 2 +- lib/init.lua | 7 ++----- wally.toml | 10 ++++++++++ 5 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 wally.toml diff --git a/.gitignore b/.gitignore index 367f047..5cacfc1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ /*.rbxlx.lock /*.rbxl.lock /*.rbxm -/build \ No newline at end of file +/build +/sourcemap.json \ No newline at end of file diff --git a/aftman.toml b/aftman.toml index a3d7a6d..fbe5356 100644 --- a/aftman.toml +++ b/aftman.toml @@ -3,5 +3,5 @@ # To add a new tool, add an entry to this table. [tools] -rojo = "rojo-rbx/rojo@7.2.1" -# rojo = "rojo-rbx/rojo@6.2.0" \ No newline at end of file +rojo = "rojo-rbx/rojo@7.3.0" +wally = "UpliftGames/wally@0.3.1" \ No newline at end of file diff --git a/default.project.json b/default.project.json index 38a4248..99a7e03 100644 --- a/default.project.json +++ b/default.project.json @@ -1,5 +1,5 @@ { - "name": "ThreadPool", + "name": "threadpool", "tree": { "$path": "lib" } diff --git a/lib/init.lua b/lib/init.lua index 18eb67d..55408ca 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -1,7 +1,7 @@ --!strict --[[ - Thread Pool 1.0.0-beta3 + Thread Pool 1.0.0 A library for creating Thread Pools to improve performance and reduce latency. https://clownxz.github.io/ThreadPool/ @@ -82,8 +82,6 @@ end @return void ]=] function ThreadPool:_createThread() - local closeThread = false - -- Create new thread and add it to the openThreads table local newThread: thread | nil newThread = coroutine.create(self._yield) @@ -93,13 +91,12 @@ function ThreadPool:_createThread() local index = #self._openThreads + 1 task.delay(self._cachedThreadLifetime, function() - closeThread = true newThread = nil self._openThreads[index] = nil end) end - coroutine.resume(newThread :: thread, closeThread) + coroutine.resume(newThread :: thread, self) table.insert(self._openThreads, newThread) end diff --git a/wally.toml b/wally.toml new file mode 100644 index 0000000..fa22842 --- /dev/null +++ b/wally.toml @@ -0,0 +1,10 @@ +[package] +name = "clownxz/threadpool" +description = "A library for creating Thread Pools to improve performance and reduce latency." +version = "1.0.0" +license = "MIT" +authors = ["Clownxz"] +realm = "shared" +registry = "https://github.com/upliftgames/wally-index" +exclude = ["**"] +include = ["lib", "lib/*", "default.project.json", "wally.toml", "wally.lock"] \ No newline at end of file