@@ -0,0 +1,17 @@
+return {
+ summary = 'Get the Thread\s error message.',
+ description = [[
+ Returns the message for the error that occurred on the Thread, or nil if no error has occurred.
+ ]],
+ arguments = {},
+ returns = {
+ {
+ name = 'error',
+ type = 'string',
+ description = 'The error message, or nil if no error has occurred on the Thread.'
+ }
+ },
+ related = {
+ 'lovr.threaderror'
+}
@@ -0,0 +1,14 @@
+ summary = 'A separate thread of execution that can run code in parallel with other threads.',
+ A Thread is an object that runs a chunk of Lua code in the background. Threads are completely
+ isolated from other threads, meaning they have their own Lua context and can't access the
+ variables and functions of other threads. Communication between threads is limited and is
+ accomplished by using `Channel` objects.
+ constructor = { 'lovr.thread.newThread' },
+ 'lovr.threaderror',
+ 'Channel'
@@ -0,0 +1,15 @@
+ summary = 'Check if the Thread is running.',
+ description = 'Returns whether or not the Thread is currently running.',
+ name = 'running',
+ type = 'boolean',
+ description = 'Whether or not the Thread is running.'
+ 'Thread:start'
@@ -0,0 +1,6 @@
+ summary = 'Start the Thread.',
+ description = 'Starts the Thread.',
+ returns = {}
@@ -0,0 +1,9 @@
+ summary = 'Wait for the Thread to complete.',
+ description = 'Waits for the Thread to complete, then returns.',
+ returns = {},
+ 'Thread:isRunning'
@@ -16,4 +16,8 @@ return {
}
},
notes = 'The Thread won\'t start running immediately. Use `Thread:start` to start it.',
+ 'Thread:start',