[AGENT++] Don't we need to destroy the mutex in the destructor?

Fedja Jeleskovic mrawd2 at gmail.com
Tue Mar 8 18:35:35 CET 2005


Hi there!

I was looking into the reentrant.cpp snmp++ file and there are no mutex destroy line for the non WIN32 versions. Don't we need to have a pthread_mutex_destroy(&_mutex) in there as well?

Thanks


Fedja
ps. Part of the code from the snmp++/src/reentrant.cpp :
SnmpSynchronized::SnmpSynchronized()
{
#ifdef _THREADS
#ifdef WIN32
 InitializeCriticalSection(&_mutex);
#else
 pthread_mutex_init(&_mutex, 0);
#endif
#endif
}

SnmpSynchronized::~SnmpSynchronized()
{
#ifdef _THREADS
#ifdef WIN32
 DeleteCriticalSection(&_mutex);
#endif
#endif
}




More information about the AGENTPP mailing list