Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » SQL Anywhere Server - SQL Reference » SQL statements » Alphabetical list of SQL statements

RELEASE MUTEX statement

Releases the specified connection-scope mutex, if it is locked by the current connection.

Syntax
RELEASE MUTEX [ owner.]mutex-name
Parameters
  • owner

    The owner of the mutex. owner can also be specified using an indirect identifier (for example, `[@variable-name]`).

  • mutex-name

    The name of the mutex. mutex-name can also be specified using an indirect identifier (for example, `[@variable-name]`).

Remarks

The RELEASE MUTEX statement releases one instance of lock on the mutex. So, if a connection has locked the mutex multiple times, then only one lock on the mutex is released per RELEASE MUTEX statement.

An error is returned if the mutex was not locked by the current connection or if the release is being requested for a transaction-scope mutex.

The RELEASE MUTEX statement will succeed on a dropped mutex that is locked by the current connection.

Privileges

You must have the UPDATE ANY MUTEX SEMAPHORE system privilege, or be the owner of the mutex.

Side effects

None.

Standards
  • ANSI/ISO SQL Standard

    Not in the standard.

Example

The following statement releases the protect_my_cr_section mutex:

RELEASE MUTEX protect_my_cr_section;