Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.3 . Technical Reference - <b>_xvlockcount()</b> http://www.X-Hacker.org [<<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()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson