mutex::~mutex()
   {
#ifdef CRNLIB_BUILD_DEBUG
      if (m_lock_count)
         crnlib_assert("mutex::~mutex: mutex is still locked", __FILE__, __LINE__);
#endif
      if (pthread_mutex_destroy(&m_mutex))
         crnlib_assert("mutex::~mutex: pthread_mutex_destroy() failed", __FILE__, __LINE__);
   }
   void mutex::unlock()
   {
#ifdef CRNLIB_BUILD_DEBUG
      if (!m_lock_count)
         crnlib_assert("mutex::unlock: mutex is not locked", __FILE__, __LINE__);
      m_lock_count--;
#endif
      pthread_mutex_unlock(&m_mutex);
   }
Exemple #3
0
 void crnlib_mem_error(const char* p_msg)
 {
    crnlib_assert(p_msg, __FILE__, __LINE__);
 }