[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _xvlockcount()
 Determine the number of locks on a VM segment
------------------------------------------------------------------------------
 C Prototype

     #include "vm.api"
     USHORT _xvlockcount(
                          HANDLE hSegment
                        )

 Arguments

     hSegment is the VM segment handle returned by _xvalloc().

 Returns

     _xvlockcount() returns the number of locks on the VM segment.

 Description

     _xvlockcount() returns the number of locks active on the VM segment.  If
     the lock count is zero, the segment is unlocked.

     You can also use _xvlockcount() on segment heaps.  Every locked block of
     allocated memory within the segment heap registers as one lock.

 Examples

     .  This example resizes a segment heap if it is not currently
        locked:

        // CA-Clipper include files
        #include "extend.api"
        #include "vm.api"

        // Prototype
        Boolean HeapResize(HANDLE hSegment, unsigned uiNewSize);


        Boolean HeapResize(HANDLE hSegment, unsigned uiNewSize)
        {
           Boolean bResult = FALSE;

           // Don't attempt to resize locked segment
           //
           if (_xvlockcount(hSegment) == 0)
              {
              if (_xvheapresize(hSegment, uiNewSize))
                 bResult = TRUE;
              }

           return (bResult);
        }

 Files  Library is CLIPPER.LIB, header file is Vm.api.


See Also: _xvheaplock() _xvlock() _xvunlock() _xvwire()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson