I'm trying to add one plug in for ntop.I did some reverse Engineering
using other plug in code like rrdplugin.c and netflowPlugin.c.
But I'm facing problem while terminating the mainloopthread is not terminating


static void termmypluginFunct(u_char termNtop /* 0=term plugin, 1=term ntop */)
{

  int rc;
  pluginActive = 0;

   if(mainThread) {
      rc = killThread(&mainThread);
      if (rc == 0)
        traceEvent(CONST_TRACE_INFO,
                   "THREADMGMT[t%lu]:myplugin: killThread(mainThread)
succeeded",
                   (long unsigned int)pthread_self());
      else
        traceEvent(CONST_TRACE_ERROR,
                   "THREADMGMT[t%lu]: myplugin: killThread(mainThread)
failed, rc %s(%d)",
                   (long unsigned int)pthread_self(), strerror(rc), rc);
    };
}

It show success message while terminating but still mainthread continue to run

So how am I going to kill the thread when i press deactivate ?
_______________________________________________
Ntop-dev mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev

Reply via email to