L3DT documentation
Large 3D terrain generator

zmap_tile_SetLock

Description

Depending on the function arguments, this function:

  • Locks a mosaic tile in memory so that it will not be de-cached until the lock is released, or;
  • Releases the lock on a mosaic tile.

Files

Declaration Zeolite.h
Implementation Zeolite.cpp

Function prototype

bool zmap_tile_SetLock(void* hTile, bool LockState);

Arguments

Name Type Comment
hTile void* A handle to the mosaic tile to be locked/unlocked.
LockState bool The desired lock state. true = locked, false = unlocked.

Return value

False if an error occurred, and true otherwise.

Comments

Infinite loops

Do not call zmap_tile_SetLock in a file format plugin when loading/saving a mosaic tile, as zmap_tile_SetLock may load/save the tile in question, which calls your function again, and we have a recursive infinite loop.

Unlocking tiles

Tiles are not automatically unloaded when zmap_tile_SetLock is called with a LockState argument of false, as different threads/plugins may have locks on the same tile. Calling zmap_tile_SetLock with a LockState of false will not release these other locks.

Only unlock tiles that you have locked

Title says it all.

 
zeolite/functions/zmap_tile_setlock.txt · Last modified: 2017/08/31 05:46 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki