Obtaining a latch (ISGLOBT and ISGLOB64 services)

Once your application creates one or more latch sets, requestors can call the Latch_Obtain service to obtain latches for exclusive or shared access to resources. Requestors must call Latch_Obtain from the same primary address space from which the Latch_Create service was called to create the associated latch set.

When a requestor calls Latch_Obtain, the latch manager does one of the following:
  • If the latch is available, grants ownership to the requestor immediately
  • If the latch is not immediately available, performs an action specified by the requestor (see Specifying an obtain option for descriptions of the various actions).

In cases where the latch manager finds contention for a requested latch, the Latch_Obtain service performs more slowly than in cases where latch manager can grant ownership of the latch to the requestor immediately.