Use Callable in Thread::start

This commit is contained in:
LATRio
2021-09-25 22:07:13 +09:00
parent 9293c76636
commit 97c68514c4
3 changed files with 17 additions and 40 deletions

View File

@@ -27,12 +27,11 @@
</method>
<method name="start">
<return type="int" enum="Error" />
<argument index="0" name="instance" type="Object" />
<argument index="1" name="method" type="StringName" />
<argument index="2" name="userdata" type="Variant" default="null" />
<argument index="3" name="priority" type="int" enum="Thread.Priority" default="1" />
<argument index="0" name="callable" type="Callable" />
<argument index="1" name="userdata" type="Variant" default="null" />
<argument index="2" name="priority" type="int" enum="Thread.Priority" default="1" />
<description>
Starts a new [Thread] that runs [code]method[/code] on object [code]instance[/code] with [code]userdata[/code] passed as an argument. Even if no userdata is passed, [code]method[/code] must accept one argument and it will be null. The [code]priority[/code] of the [Thread] can be changed by passing a value from the [enum Priority] enum.
Starts a new [Thread] that calls [code]callable[/code] with [code]userdata[/code] passed as an argument. Even if no userdata is passed, [code]method[/code] must accept one argument and it will be null. The [code]priority[/code] of the [Thread] can be changed by passing a value from the [enum Priority] enum.
Returns [constant OK] on success, or [constant ERR_CANT_CREATE] on failure.
</description>
</method>