Code Block |
---|
Mib mib;
...
mib->lock_mib();
// code to lookup a MibEntry:
MibTable table = ...;
// enter protected region:
table->start_synch();
// now you can drop the Mib lock
mib->unlock_mib();
// do the real work on table
...
table->end_synch();
|
By default AGENT++ is a multi-threaded agent. Therefore access to each MibEntry in the a Mib has to be synchronized.
...
As tables and complex (sub-tree) entries may contain also MibEntry objects, for example scalars, additional levels can be implemented by the user.
In any case, the locking procedure must start with the following steps: