libcsdbg  1.28
C++ exception (and generic) stack trace debug library
tracer & csdbg::tracer::remove_plugin ( const i8 path)
virtual

Unregister a plugin module (DSO)

Parameters
[in]paththe path of the module file
Returns
*this

Definition at line 910 of file tracer.cpp.

References __D_ASSERT, likely, csdbg::util::lock(), m_plugins, csdbg::plugin::path(), unlikely, and csdbg::util::unlock().

911 {
912  __D_ASSERT(path != NULL);
913  if ( unlikely(path == NULL) )
914  return *this;
915 
916  util::lock();
917  for (u32 i = 0, sz = m_plugins->size(); likely(i < sz); i++) {
918  const plugin *plg = m_plugins->at(i);
919 
920  /* If this is an inline plugin */
921  if ( unlikely(plg->path() == NULL) )
922  continue;
923 
924  if ( unlikely(strcmp(plg->path(), path) == 0) ) {
925  m_plugins->remove(i);
926  break;
927  }
928  }
929 
930  util::unlock();
931  return *this;
932 }
chain< plugin > * m_plugins
Instrumentation plugins.
Definition: tracer.hpp:48
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
Definition: config.hpp:344
static void lock()
Lock the global access mutex.
Definition: util.cpp:397
static void unlock()
Unlock the global access mutex.
Definition: util.cpp:406
unsigned int u32
32-bit unsigned integer
Definition: config.hpp:102
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349
#define __D_ASSERT(x)
Assertion macro.
Definition: config.hpp:268

+ Here is the call graph for this function: