Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ RW_TRYRDLOCK(D3) — UnixWare 2.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought






       RW_TRYRDLOCK(D3)                                    RW_TRYRDLOCK(D3)


       NAME
             RW_TRYRDLOCK - try to acquire a read/write lock in read mode

       SYNOPSIS
             #include <sys/types.h>
             #include <sys/ksynch.h>
             #include <sys/ddi.h>
             pl_t RW_TRYRDLOCK(rwlock_t *lockp, pl_t pl);

          Arguments
             lockp     Pointer to the read/write lock to be acquired.

             pl        The interrupt priority level to be set while the
                       lock is held by the caller.

       DESCRIPTION
             If the lock specified by lockp is immediately available in
             read mode (there is not a writer holding the lock and there
             are no waiting writers), the RW_TRYRDLOCK function sets the
             interrupt priority level in accordance with the value
             specified by pl (if required by the implementation) and
             acquires the lock in read mode.  If the lock is not
             immediately available in read mode, RW_TRYLOCK returns without
             acquiring the lock.

          Return Values
             If the lock is acquired, RW_TRYRDLOCK returns the previous
             interrupt priority level (plbase - plhi).  If the lock is not
             acquired the value invpl is returned.

       USAGE
             Because some implementations require that interrupts that
             might attempt to acquire the lock be blocked on the processor
             on which the lock is held, portable drivers must specify a pl
             value that is sufficient to block out any interrupt handler
             that might attempt to acquire this lock.  See the description
             of the min_pl argument to RW_ALLOC(D3) for additional
             discussion and a list of the valid values for pl.
             Implementations which do not require that the interrupt
             priority level be raised during lock acquisition may choose to
             ignore this argument.

             When called from interrupt level, the pl argument must not
             specify a priority level below the level at which the
             interrupt handler is running.



                           Copyright 1994 Novell, Inc.               Page 1













      RW_TRYRDLOCK(D3)                                    RW_TRYRDLOCK(D3)


            RW_TRYRDLOCK may be used to acquire a lock in a different
            order from the order defined by the lock hierarchy.

         Level
            Base or Interrupt.

         Synchronization Constraints
            Does not sleep.

            Driver-defined basic locks, read/write locks, and sleep locks
            may be held across calls to this function.

      REFERENCES
            RW_ALLOC(D3), RW_DEALLOC(D3), RW_RDLOCK(D3), RW_TRYWRLOCK(D3),
            RW_UNLOCK(D3), RW_WRLOCK(D3)

      NOTICES
         Portability
            All processors

         Applicability
            ddi: 5, 5mp, 6, 6mp, 7, 7mp


























                          Copyright 1994 Novell, Inc.               Page 2








Typewritten Software • bear@typewritten.org • Edmonds, WA 98026