This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

own

Check ownership of advisory lock on a persistence service mutex object

Syntax

TF = own(lk)

Description

example

TF = own(lk) returns a logical 1 (true) if you own an advisory lock on the persistence service mutex, and returns a logical 0 (false) otherwise.

Examples

collapse all

First, create a persistence service controller object and use that object to start the persistence service.

ctrl = mps.cache.control('myRedisConnection','Redis','Port',4519);
start(ctrl)

Use the connection name to create a persistence service mutex.

lk = mps.sync.lock('myDbLock','Connection','myRedisConnection')

Check if you own the advisory lock.

TF = own(lk)
TF =

  logical

   0

Input Arguments

collapse all

A persistence service specific mutex object. If you use Redis™ as your persistence provider, lk will be a mps.sync.TimedRedisMutex object. If you use a MATLAB® as your persistence provider, lk will be a mps.sync.TimedMATFileMutex object.

Output Arguments

collapse all

TF has a logical 1 (true) if you own the advisory lock on the persistence service mutex, and a logical 0 (false) otherwise.

Introduced in R2018b