HANDLE p_mutex;
};
-wxMutex::wxMutex(void)
+wxMutex::wxMutex()
{
p_internal = new wxMutexInternal;
p_internal->p_mutex = CreateMutex(NULL, FALSE, NULL);
m_locked = 0;
}
-wxMutex::~wxMutex(void)
+wxMutex::~wxMutex()
{
+ if (m_locked > 0)
+ wxDebugMsg("wxMutex warning: freeing a locked mutex (%d locks)\n", m_locked);
CloseHandle(p_internal->p_mutex);
}
-wxMutexError wxMutex::Lock(void)
+wxMutexError wxMutex::Lock()
{
DWORD ret;
return MUTEX_NO_ERROR;
}
-wxMutexError wxMutex::TryLock(void)
+wxMutexError wxMutex::TryLock()
{
DWORD ret;
return MUTEX_NO_ERROR;
}
-wxMutexError wxMutex::Unlock(void)
+wxMutexError wxMutex::Unlock()
{
BOOL ret;
int waiters;
};
-wxCondition::wxCondition(void)
+wxCondition::wxCondition()
{
p_internal = new wxConditionInternal;
p_internal->event = CreateEvent(NULL, FALSE, FALSE, NULL);
p_internal->waiters = 0;
}
-wxCondition::~wxCondition(void)
+wxCondition::~wxCondition()
{
CloseHandle(p_internal->event);
}
return (ret != WAIT_TIMEOUT);
}
-void wxCondition::Signal(void)
+void wxCondition::Signal()
{
SetEvent(p_internal->event);
}
-void wxCondition::Broadcast(void)
+void wxCondition::Broadcast()
{
int i;
return ret;
}
-wxThreadError wxThread::Create(void)
+wxThreadError wxThread::Create()
{
int win_prio, prio = p_internal->prio;
p_internal->prio = prio;
}
-int wxThread::GetPriority(void)
+int wxThread::GetPriority() const
{
return p_internal->prio;
}
return (void *)exit_code;
}
-unsigned long wxThread::GetID()
+unsigned long wxThread::GetID() const
{
return (unsigned long)p_internal->tid;
}
class wxThreadModule : public wxModule {
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
- virtual bool OnInit(void) {
+ virtual bool OnInit() {
p_mainid = GetCurrentThread();
wxMainMutex.Lock();
return TRUE;
}
// Global cleanup
- virtual void OnExit(void) {
+ virtual void OnExit() {
wxMainMutex.Unlock();
}
};