next up previous contents
Next: Function descriptions Up: Principal and Policy Databases Previous: Error codes   Contents

Locking

All of the osa_adb functions except open and close lock and unlock the database to prevent concurrency collisions. The overall locking algorithm is as follows:

  1. osa_adb_open_T calls osa_adb_init_db to allocate the osa_adb_T_t structure and open the locking file for further use.

  2. Each osa_adb functions locks the locking file and opens the appropriate database with osa_adb_open_and_lock, performs its action, and then closes the database and unlocks the locking file with osa_adb_close_and_unlock.

  3. osa_adb_close_T calls osa_adb_fini_db to close the locking file and deallocate the db structure.

Functions which modify the database acquire an exclusive lock, others acqure a shared lock. osa_adb_iter_T acquires an exclusive lock for safety but as stated below consequences of modifying the database in the iteration function are undefined.



Autobuild 2009-09-05