OpenVMS Alpha Galaxy Guide
←Previous Next→ Contents Tables Close Download Help
  13.8  SYS$ACQUIRE_GALAXY_LOCK

  This service is used to acquire ownership of a galaxy lock.  If
  the lock is free, the caller becomes the owner and control re-
  turns immediately.  If the lock is owned, based on the input
  flags and the timeout value, either the caller will wait or an
  error will be returned.

  The default behavior when an attempt is made to acquire a
  lock that is owned, is to spin for 10 microseconds and then
  to wait.  If a wait timeout value was specified in the call,
  it is used.  Otherwise the timeout value set in the lock by
  SYS$CREATE_GALAXY_LOCK or SYS$INIT_GALAXY_

  LOCK will be used.  This behavior can be changed with the
  input flags.

  If just GLOCK$C_NOSPIN is specified and the lock is owned,
  no spin will be done.

  If just GLOCK$C_NOWAIT is specified and the lock is
  owned, the caller will only spin on the lock.  If a time-
  out value is specified in the call, it is used as the spin time.

  Otherwise, the caller will spin for 10 microseconds.  If the
  lock does not become available during the spin, the lock is not
  acquired and SS$_NOWAIT is returned.

  If both GLOCK$C_NOSPIN and GLOCK$C_NOWAIT are
  specified and the lock is owned, control returns immediately.
  The lock is not acquired and SS$_NOWAIT is returned.

  Due to system events such a galaxy instance shutting down,
  a lock may become owned by a non-existent entity.  If this
  occurs, the default behavior of SYS$ACQUIRE_GALAXY_
  LOCK is to break the old lock ownership.  The caller be-
  comes the new owner and the service returns SS$_BROKEN.
  If GLOCK$C_NOBREAK is specified, SYS$ACQUIRE_
  GALAXY_LOCK will not break the lock ownership and
  returns SS$_NOBREAK.

  sys$acquire_galaxy_lock(handle, timeout, flags)

                 size

  parameter      (bytes)      type                   usage

  handle         8            input by value         galaxy lock
                                                     handle
  timeout        4            input by value         wait time-
                                                     out (overrides
                                                     default)

  flags          4            input by value         GLOCK$C_
                                                     NOWAIT
                                                     GLOCK$C_
                                                     NOSPIN
                                                     GLOCK$C_
                                                     NOBREAK

  Return status:

      SS$_BADPARAM
      SS$_BROKEN
      SS$_IVLOCKID
      SS$_IVLOCKOP

      SS$_IVLOCKTBL
      SS$_LOCK_TIMEOUT
      SS$_NOBREAK

      SS$_NOWAIT
      SS$_NORMAL
←Previous Next→ Contents Tables Close Download Help