Child pages
  • What is the lock order for Mib objects to protected them multi-threaded agent?

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you need to add/remove objects from the Mib, the locking schema looks sligtly different:

Code Block
Mib* mib;
...

mib->lock_mib();

// code to lookup a MibEntry:
MibTable table = ...;

// enter protected region:
table->start_synch();
 
// remove table from Mib:
MibContext* ctx = mib->get_context(DEFAULT_CONTEXT);
ctx->remove(*table->key());
table->end_synch();
delete table;
// now you can drop the Mib lock
mib->unlock_mib();

...