Share via


SQLiteDatabase.YieldIfContendedSafely Method

Definition

Overloads

YieldIfContendedSafely()

Temporarily end the transaction to let other threads run.

YieldIfContendedSafely(Int64)

Temporarily end the transaction to let other threads run.

YieldIfContendedSafely()

Temporarily end the transaction to let other threads run.

[Android.Runtime.Register("yieldIfContendedSafely", "()Z", "GetYieldIfContendedSafelyHandler")]
public virtual bool YieldIfContendedSafely ();
[<Android.Runtime.Register("yieldIfContendedSafely", "()Z", "GetYieldIfContendedSafelyHandler")>]
abstract member YieldIfContendedSafely : unit -> bool
override this.YieldIfContendedSafely : unit -> bool

Returns

true if the transaction was yielded

Attributes

Remarks

Temporarily end the transaction to let other threads run. The transaction is assumed to be successful so far. Do not call setTransactionSuccessful before calling this. When this returns a new transaction will have been created but not marked as successful. This assumes that there are no nested transactions (beginTransaction has only been called once) and will throw an exception if that is not the case.

Java documentation for android.database.sqlite.SQLiteDatabase.yieldIfContendedSafely().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

YieldIfContendedSafely(Int64)

Temporarily end the transaction to let other threads run.

[Android.Runtime.Register("yieldIfContendedSafely", "(J)Z", "GetYieldIfContendedSafely_JHandler")]
public virtual bool YieldIfContendedSafely (long sleepAfterYieldDelay);
[<Android.Runtime.Register("yieldIfContendedSafely", "(J)Z", "GetYieldIfContendedSafely_JHandler")>]
abstract member YieldIfContendedSafely : int64 -> bool
override this.YieldIfContendedSafely : int64 -> bool

Parameters

sleepAfterYieldDelay
Int64

if > 0, sleep this long before starting a new transaction if the lock was actually yielded. This will allow other background threads to make some more progress than they would if we started the transaction immediately.

Returns

true if the transaction was yielded

Attributes

Remarks

Temporarily end the transaction to let other threads run. The transaction is assumed to be successful so far. Do not call setTransactionSuccessful before calling this. When this returns a new transaction will have been created but not marked as successful. This assumes that there are no nested transactions (beginTransaction has only been called once) and will throw an exception if that is not the case.

Java documentation for android.database.sqlite.SQLiteDatabase.yieldIfContendedSafely(long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to