mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-11 00:58:14 +08:00
removed exception specifications. thread exceptions weren't
being listed and they'd have to be added to every one. just doesn't seem worth the trouble.
This commit is contained in:
@@ -21,12 +21,12 @@ CCondVarBase::~CCondVarBase()
|
||||
fini();
|
||||
}
|
||||
|
||||
void CCondVarBase::lock() const throw()
|
||||
void CCondVarBase::lock() const
|
||||
{
|
||||
m_mutex->lock();
|
||||
}
|
||||
|
||||
void CCondVarBase::unlock() const throw()
|
||||
void CCondVarBase::unlock() const
|
||||
{
|
||||
m_mutex->unlock();
|
||||
}
|
||||
@@ -37,7 +37,7 @@ bool CCondVarBase::wait(double timeout) const
|
||||
return wait(timer, timeout);
|
||||
}
|
||||
|
||||
CMutex* CCondVarBase::getMutex() const throw()
|
||||
CMutex* CCondVarBase::getMutex() const
|
||||
{
|
||||
return m_mutex;
|
||||
}
|
||||
@@ -65,14 +65,14 @@ void CCondVarBase::fini()
|
||||
delete cond;
|
||||
}
|
||||
|
||||
void CCondVarBase::signal() throw()
|
||||
void CCondVarBase::signal()
|
||||
{
|
||||
pthread_cond_t* cond = reinterpret_cast<pthread_cond_t*>(m_cond);
|
||||
int status = pthread_cond_signal(cond);
|
||||
assert(status == 0);
|
||||
}
|
||||
|
||||
void CCondVarBase::broadcast() throw()
|
||||
void CCondVarBase::broadcast()
|
||||
{
|
||||
pthread_cond_t* cond = reinterpret_cast<pthread_cond_t*>(m_cond);
|
||||
int status = pthread_cond_broadcast(cond);
|
||||
@@ -143,7 +143,7 @@ bool CCondVarBase::wait(
|
||||
CThread::testCancel();
|
||||
|
||||
// check wait status
|
||||
if (status != ETIMEDOUT)
|
||||
if (status != ETIMEDOUT && status != EINTR)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ void CCondVarBase::fini()
|
||||
delete[] events;
|
||||
}
|
||||
|
||||
void CCondVarBase::signal() throw()
|
||||
void CCondVarBase::signal()
|
||||
{
|
||||
// is anybody waiting?
|
||||
bool hasWaiter;
|
||||
@@ -213,7 +213,7 @@ void CCondVarBase::signal() throw()
|
||||
SetEvent(reinterpret_cast<HANDLE*>(m_cond)[kSignal]);
|
||||
}
|
||||
|
||||
void CCondVarBase::broadcast() throw()
|
||||
void CCondVarBase::broadcast()
|
||||
{
|
||||
// is anybody waiting?
|
||||
bool hasWaiter;
|
||||
|
||||
@@ -17,13 +17,13 @@ class CCondVarBase {
|
||||
// manipulators
|
||||
|
||||
// lock/unlock the mutex. see CMutex.
|
||||
void lock() const throw();
|
||||
void unlock() const throw();
|
||||
void lock() const;
|
||||
void unlock() const;
|
||||
|
||||
// signal the condition. Signal() wakes one waiting thread.
|
||||
// Broadcast() wakes all waiting threads.
|
||||
void signal() throw();
|
||||
void broadcast() throw();
|
||||
void signal();
|
||||
void broadcast();
|
||||
|
||||
// accessors
|
||||
|
||||
@@ -43,7 +43,7 @@ class CCondVarBase {
|
||||
bool wait(CStopwatch&, double timeout) const;
|
||||
|
||||
// get the mutex passed to the c'tor
|
||||
CMutex* getMutex() const throw();
|
||||
CMutex* getMutex() const;
|
||||
|
||||
private:
|
||||
void init();
|
||||
@@ -83,7 +83,7 @@ class CCondVar : public CCondVarBase {
|
||||
|
||||
// get the const value. this object should be locked before
|
||||
// calling this method.
|
||||
operator const T&() const throw();
|
||||
operator const T&() const;
|
||||
|
||||
private:
|
||||
T m_data;
|
||||
@@ -131,7 +131,7 @@ CCondVar<T>& CCondVar<T>::operator=(const T& data)
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
CCondVar<T>::operator const T&() const throw()
|
||||
CCondVar<T>::operator const T&() const
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
|
||||
@@ -6,17 +6,17 @@
|
||||
// CLock
|
||||
//
|
||||
|
||||
CLock::CLock(const CMutex* mutex) throw() : m_mutex(mutex)
|
||||
CLock::CLock(const CMutex* mutex) : m_mutex(mutex)
|
||||
{
|
||||
m_mutex->lock();
|
||||
}
|
||||
|
||||
CLock::CLock(const CCondVarBase* cv) throw() : m_mutex(cv->getMutex())
|
||||
CLock::CLock(const CCondVarBase* cv) : m_mutex(cv->getMutex())
|
||||
{
|
||||
m_mutex->lock();
|
||||
}
|
||||
|
||||
CLock::~CLock() throw()
|
||||
CLock::~CLock()
|
||||
{
|
||||
m_mutex->unlock();
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ class CCondVarBase;
|
||||
|
||||
class CLock {
|
||||
public:
|
||||
CLock(const CMutex* mutex) throw();
|
||||
CLock(const CCondVarBase* cv) throw();
|
||||
~CLock() throw();
|
||||
CLock(const CMutex* mutex);
|
||||
CLock(const CCondVarBase* cv);
|
||||
~CLock();
|
||||
|
||||
private:
|
||||
// not implemented
|
||||
|
||||
@@ -48,7 +48,7 @@ void CMutex::fini()
|
||||
delete mutex;
|
||||
}
|
||||
|
||||
void CMutex::lock() const throw()
|
||||
void CMutex::lock() const
|
||||
{
|
||||
pthread_mutex_t* mutex = reinterpret_cast<pthread_mutex_t*>(m_mutex);
|
||||
int status = pthread_mutex_lock(mutex);
|
||||
@@ -71,7 +71,7 @@ void CMutex::lock() const throw()
|
||||
}
|
||||
}
|
||||
|
||||
void CMutex::unlock() const throw()
|
||||
void CMutex::unlock() const
|
||||
{
|
||||
pthread_mutex_t* mutex = reinterpret_cast<pthread_mutex_t*>(m_mutex);
|
||||
int status = pthread_mutex_unlock(mutex);
|
||||
@@ -110,12 +110,12 @@ void CMutex::fini()
|
||||
delete mutex;
|
||||
}
|
||||
|
||||
void CMutex::lock() const throw()
|
||||
void CMutex::lock() const
|
||||
{
|
||||
::EnterCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(m_mutex));
|
||||
}
|
||||
|
||||
void CMutex::unlock() const throw()
|
||||
void CMutex::unlock() const
|
||||
{
|
||||
::LeaveCriticalSection(reinterpret_cast<CRITICAL_SECTION*>(m_mutex));
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ class CMutex {
|
||||
|
||||
// accessors
|
||||
|
||||
void lock() const throw();
|
||||
void unlock() const throw();
|
||||
void lock() const;
|
||||
void unlock() const;
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
||||
Reference in New Issue
Block a user