Enum gdnative::nativescript::user_data::DeadlockPolicy[][src]

pub enum DeadlockPolicy {
    Allow,
    Pessimistic,
    Timeout(Duration),
}

Policies to deal with potential deadlocks

As Godot allows mutable pointer aliasing, doing certain things in exported method bodies may lead to the engine calling another method on owner, leading to another locking attempt within the same thread:

  • Variant calls on anything may dispatch to a script method.
  • Anything that could emit signals, that are connected to in a non-deferred manner.

As there is no universal way to deal with such situations, behavior of locking wrappers can be customized using this enum.

Variants

Allow

Block on all locks. Deadlocks are possible.

Pessimistic

Never block on any locks. Methods will return Nil immediately if the lock isn't available. Deadlocks are prevented.

Timeout(Duration)

Block on locks for at most Duration. Methods return Nil on timeout. Deadlocks are prevented.

Trait Implementations

impl Clone for DeadlockPolicy[src]

impl Copy for DeadlockPolicy[src]

impl Debug for DeadlockPolicy[src]

impl Eq for DeadlockPolicy[src]

impl Hash for DeadlockPolicy[src]

impl Ord for DeadlockPolicy[src]

impl PartialEq<DeadlockPolicy> for DeadlockPolicy[src]

impl PartialOrd<DeadlockPolicy> for DeadlockPolicy[src]

impl StructuralEq for DeadlockPolicy[src]

impl StructuralPartialEq for DeadlockPolicy[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CallHasher for T where
    T: Hash + ?Sized

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.