mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Add thread safety to Object signals
* It turns out the majority of this work was done already by AThousandShips as part of #89451. This allows to do lock-less emitting of signals. * This means, that only the signal map needs to be protected, making the task simple and without risk of deadlocks, or affecting performance. * Objects can choose to not protect signals for performance (as example Node uses thread guards for protection, so these signals are not thread safe).
This commit is contained in:
@@ -521,6 +521,7 @@
|
||||
A signal can only be connected once to the same [Callable]. If the signal is already connected, this method returns [constant ERR_INVALID_PARAMETER] and generates an error, unless the signal is connected with [constant CONNECT_REFERENCE_COUNTED]. To prevent this, use [method is_connected] first to check for existing connections.
|
||||
[b]Note:[/b] If the [param callable]'s object is freed, the connection will be lost.
|
||||
[b]Note:[/b] In GDScript, it is generally recommended to connect signals with [method Signal.connect] instead.
|
||||
[b]Note:[/b] This operation (and all other signal related operations) is thread-safe.
|
||||
</description>
|
||||
</method>
|
||||
<method name="disconnect">
|
||||
|
||||
Reference in New Issue
Block a user