Classref: Mutex, Semaphore, Thread, *Array (#5278)

This commit is contained in:
J08nY 2016-06-18 21:21:29 +02:00 committed by Rémi Verschelde
parent 5e7f1fc79b
commit b587a13293
1 changed files with 43 additions and 15 deletions

View File

@ -8459,7 +8459,7 @@
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Resize the array. Set the size of the [ColorArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
</description> </description>
</method> </method>
<method name="set"> <method name="set">
@ -8468,7 +8468,7 @@
<argument index="1" name="color" type="Color"> <argument index="1" name="color" type="Color">
</argument> </argument>
<description> <description>
Set an index in the array. Change the [Color] at the given index.
</description> </description>
</method> </method>
<method name="size"> <method name="size">
@ -16981,7 +16981,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Resize the array. Set the size of the [IntArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
</description> </description>
</method> </method>
<method name="set"> <method name="set">
@ -16990,7 +16990,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="1" name="integer" type="int"> <argument index="1" name="integer" type="int">
</argument> </argument>
<description> <description>
Set an index in the array. Change the int at the given index.
</description> </description>
</method> </method>
<method name="size"> <method name="size">
@ -20500,22 +20500,27 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
</class> </class>
<class name="Mutex" inherits="Reference" category="Core"> <class name="Mutex" inherits="Reference" category="Core">
<brief_description> <brief_description>
A synchronization Mutex.
</brief_description> </brief_description>
<description> <description>
A synchronization Mutex. Element used in multi-threadding. Basically a binary [Semaphore]. Guarantees that only one thread has this lock, can be used to protect a critical section.
</description> </description>
<methods> <methods>
<method name="lock"> <method name="lock">
<description> <description>
Lock this [Mutex], blocks until it is unlocked by the current owner.
</description> </description>
</method> </method>
<method name="try_lock"> <method name="try_lock">
<return type="Error"> <return type="Error">
</return> </return>
<description> <description>
Try locking this [Mutex], does not block. Returns [OK] on success else [ERR_BUSY].
</description> </description>
</method> </method>
<method name="unlock"> <method name="unlock">
<description> <description>
Unlock this [Mutex], leaving it to others threads.
</description> </description>
</method> </method>
</methods> </methods>
@ -29997,12 +30002,14 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="byte" type="int"> <argument index="0" name="byte" type="int">
</argument> </argument>
<description> <description>
Append an element at the end of the array.
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Set the size of the [RawArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
</description> </description>
</method> </method>
<method name="set"> <method name="set">
@ -30011,12 +30018,14 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="byte" type="int"> <argument index="1" name="byte" type="int">
</argument> </argument>
<description> <description>
Change the byte at the given index.
</description> </description>
</method> </method>
<method name="size"> <method name="size">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the size of the array.
</description> </description>
</method> </method>
<method name="RawArray"> <method name="RawArray">
@ -30025,6 +30034,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="from" type="Array"> <argument index="0" name="from" type="Array">
</argument> </argument>
<description> <description>
Create from a generic array.
</description> </description>
</method> </method>
</methods> </methods>
@ -30338,12 +30348,14 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="value" type="float"> <argument index="0" name="value" type="float">
</argument> </argument>
<description> <description>
Append an element at the end of the array.
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Set the size of the [RealArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
</description> </description>
</method> </method>
<method name="set"> <method name="set">
@ -30352,12 +30364,14 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="value" type="float"> <argument index="1" name="value" type="float">
</argument> </argument>
<description> <description>
Change the float at the given index.
</description> </description>
</method> </method>
<method name="size"> <method name="size">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the size of the array.
</description> </description>
</method> </method>
<method name="RealArray"> <method name="RealArray">
@ -30366,6 +30380,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="from" type="Array"> <argument index="0" name="from" type="Array">
</argument> </argument>
<description> <description>
Create from a generic array.
</description> </description>
</method> </method>
</methods> </methods>
@ -33670,20 +33685,24 @@ This method controls whether the position between two cached points is interpola
</class> </class>
<class name="Semaphore" inherits="Reference" category="Core"> <class name="Semaphore" inherits="Reference" category="Core">
<brief_description> <brief_description>
A synchronization Semaphore.
</brief_description> </brief_description>
<description> <description>
A synchronization Semaphore. Element used in multi-threadding. Initialized to zero on creation.
</description> </description>
<methods> <methods>
<method name="wait"> <method name="wait">
<return type="Error"> <return type="Error">
</return> </return>
<description> <description>
Tries to wait for the [Semaphore], if it's value is zero, blocks until non-zero.
</description> </description>
</method> </method>
<method name="post"> <method name="post">
<return type="Error"> <return type="Error">
</return> </return>
<description> <description>
Lowers the [Semaphore], allowing one more thread in.
</description> </description>
</method> </method>
</methods> </methods>
@ -37731,7 +37750,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Reset the size of the array. Set the size of the [StringArray]. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
</description> </description>
</method> </method>
<method name="set"> <method name="set">
@ -37740,6 +37759,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="string" type="String"> <argument index="1" name="string" type="String">
</argument> </argument>
<description> <description>
Change the [String] at the given index.
</description> </description>
</method> </method>
<method name="size"> <method name="size">
@ -37755,6 +37775,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="from" type="Array"> <argument index="0" name="from" type="Array">
</argument> </argument>
<description> <description>
Create from a generic array.
</description> </description>
</method> </method>
</methods> </methods>
@ -39655,8 +39676,10 @@ This method controls whether the position between two cached points is interpola
</class> </class>
<class name="Thread" inherits="Reference" category="Core"> <class name="Thread" inherits="Reference" category="Core">
<brief_description> <brief_description>
A unit of execution in a process.
</brief_description> </brief_description>
<description> <description>
A unit of execution in a process. Can run methods on [Object]s simultaneously. The use of synchronization via [Mutex], [Semaphore] is advised if working with shared objects.
</description> </description>
<methods> <methods>
<method name="start"> <method name="start">
@ -39671,24 +39694,29 @@ This method controls whether the position between two cached points is interpola
<argument index="3" name="priority" type="int" default="1"> <argument index="3" name="priority" type="int" default="1">
</argument> </argument>
<description> <description>
Start a new [Thread], it will run "method" on object "instance" using "userdata" as an argument and running with "priority", one of PRIORITY_* enum.
Returns OK on success, or ERR_CANT_CREATE on failure.
</description> </description>
</method> </method>
<method name="get_id" qualifiers="const"> <method name="get_id" qualifiers="const">
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Return the id of the thread, uniquely identifying it among all threads.
</description> </description>
</method> </method>
<method name="is_active" qualifiers="const"> <method name="is_active" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Whether this thread is currently active, an active Thread cannot start work on a new method but can be joined with [method wait_to_finish].
</description> </description>
</method> </method>
<method name="wait_to_finish"> <method name="wait_to_finish">
<return type="Variant"> <return type="Variant">
</return> </return>
<description> <description>
Joins the [Thread] and waits for it to finish. Returns what the method called returned.
</description> </description>
</method> </method>
</methods> </methods>
@ -42610,14 +42638,14 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="vector2" type="Vector2"> <argument index="0" name="vector2" type="Vector2">
</argument> </argument>
<description> <description>
Inserts a Vector2 at the end. Insert a [Vector2] at the end.
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Sets the size of the Vector2Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array. Set the size of the Vector2Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
</description> </description>
</method> </method>
<method name="set"> <method name="set">
@ -42626,14 +42654,14 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="vector2" type="Vector2"> <argument index="1" name="vector2" type="Vector2">
</argument> </argument>
<description> <description>
Changes the Vector2 at the given index. Change the [Vector2] at the given index.
</description> </description>
</method> </method>
<method name="size"> <method name="size">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns the size of the array. Return the size of the array.
</description> </description>
</method> </method>
<method name="Vector2Array"> <method name="Vector2Array">
@ -42642,7 +42670,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="from" type="Array"> <argument index="0" name="from" type="Array">
</argument> </argument>
<description> <description>
Constructs a new Vector2Array. Optionally, you can pass in an Array that will be converted. Construct a new [Vector2Array]. Optionally, you can pass in an Array that will be converted.
</description> </description>
</method> </method>
</methods> </methods>
@ -42869,14 +42897,14 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="vector3" type="Vector3"> <argument index="0" name="vector3" type="Vector3">
</argument> </argument>
<description> <description>
Inserts a Vector3 at the end. Insert a Vector3 at the end.
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Sets the size of the Vector3Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array. Set the size of the Vector3Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
</description> </description>
</method> </method>
<method name="set"> <method name="set">
@ -42885,14 +42913,14 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="vector3" type="Vector3"> <argument index="1" name="vector3" type="Vector3">
</argument> </argument>
<description> <description>
Changes the Vector3 at the given index. Change the [Vector3] at the given index.
</description> </description>
</method> </method>
<method name="size"> <method name="size">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns the size of the array. Return the size of the array.
</description> </description>
</method> </method>
<method name="Vector3Array"> <method name="Vector3Array">
@ -42901,7 +42929,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="from" type="Array"> <argument index="0" name="from" type="Array">
</argument> </argument>
<description> <description>
Constructs a new Vector3Array. Optionally, you can pass in an Array that will be converted. Construct a new Vector3Array. Optionally, you can pass in an Array that will be converted.
</description> </description>
</method> </method>
</methods> </methods>