[AGENT++] A question concerning reentrent.h, reentrent.cpp (snmp++ 3.2.15)

Petersen, Thorsten Thorsten.Petersen at draeger.com
Thu Aug 18 14:53:16 CEST 2005


Hello

 

Inside the file reentrant.h the class SnmpSynchronized uses POSIX mutexes if the symbol "_THREADS" is defined and if we are not using windows.

 

class DLLOPT SnmpSynchronized 

{

 ...

#ifdef _THREADS

#ifdef WIN32

  CRITICAL_SECTION      _mutex;

#else

  pthread_mutex_t      _mutex;

#endif

#endif

  void lock();

  void unlock();

};

 

Using these classes, I found that the destructor of class SnmpSynchronized does not free the POSIX mutex with a call to pthread_mutex_destroy. As far as I understood the POSIX documentation, a call to pthread_mutex_destroy frees allocated resources associated with the mutex. Am I right or is the call to pthread_mutex_destroy obsolete?

 

Moreover, after a look inside the Agent++ library (3.5.22), I found that POSIX mutexes are only used it the symbol POSIX_THREADS is defined, not necessarily if only the symbol _THREADS is defined. Is this ok?

 

Regards, Thorsten

 

------------------------------------------------------------------ 

Important Note 

This email and any attachment hereto are confidential and may contain trade 

secrets or may be otherwise protected from disclosure. If you have received 

it in error you are in notice of this fact. Please notify us immediately by 

reply email and then delete this email and any attachment from your system. 

Please understand that you are not allowed to copy this email or any 

attachment hereto or disclose its contents to any other person. Thank you. 

 

Wichtiger Hinweis 

Diese E-Mail und etwaige Anlagen können Betriebs- oder Geschäftsgeheimnisse 

oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail 

irrtümlich erhalten haben, ist Ihnen dieser Umstand hiermit bekannt. Bitte 

benachrichtigen Sie uns in diesem Fall umgehend durch Rücksendung der E-Mail 

und löschen Sie diese E-Mail einschließlich etwaiger Anlagen von Ihrem 

System. Diese E-Mail und ihre Anlagen dürfen weiterhin nicht kopiert oder an 

Dritte weitergegeben werden. Vielen Dank. 

------------------------------------------------------------------ 

Thorsten Petersen <thorsten.petersen(at)draeger.com> 

Dräger Medical AG & Co. KGaA 

Moislinger Allee 53-55 

23542 Luebeck, Germany 

------------------------------------------------------------------ 

 



More information about the AGENTPP mailing list