Go to the source code of this file.
|
| class | krotos::ResourceLock |
| | Class used to manage access to a resource from multiple users / threads In this version, requests must pass in a unique identifier ID. Doing so allows keeping track of access requests seperately. This is necessary because it can happen that the same caller can request access many times, even after it has been granted access. Conversely a caller may call finishedAccessing() many times after access finished has already been registered. This ID could in fact be simply a unique integer, however, using a human readable String is a boon to debugging when sent to the logger, and the CPU overhead should not be high as these requests are not prohibitively frequent ... about 25 Hz in the case of the grain display redraw, and audio block rate in the case of access to audio data. TODO: perhaps some profiling if in doubt ? More...
|
| |