]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/threadno.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: No thread support
4 // Author: Original from Wolfram Gloger/Guilhem Lavaux
8 // Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "thread.h"
25 wxDebugMsg("wxMutex warning: destroying a locked mutex (%d locks)\n", m_locked
);
28 MutexError
wxMutex::Lock()
31 return MUTEX_NO_ERROR
;
34 MutexError
wxMutex::TryLock()
39 return MUTEX_NO_ERROR
;
42 MutexError
wxMutex::Unlock()
45 return MUTEX_UNLOCKED
;
47 return MUTEX_NO_ERROR
;
50 wxCondition::wxCondition()
54 wxCondition::~wxCondition()
58 void wxCondition::Wait(wxMutex
& WXUNUSED(mutex
))
62 bool wxCondition::Wait(wxMutex
& WXUNUSED(mutex
), unsigned long WXUNUSED(sec
),
63 unsigned long WXUNUSED(nsec
))
68 void wxCondition::Signal()
72 void wxCondition::Broadcast()
76 struct wxThreadPrivate
{
81 ThreadError
wxThread::Create()
83 p_internal
->exit_status
= Entry();
85 return THREAD_NO_ERROR
;
88 ThreadError
wxThread::Destroy()
90 return THREAD_RUNNING
;
93 void wxThread::DeferDestroy()
97 void wxThread::TestDestroy()
101 void *wxThread::Join()
103 return p_internal
->exit_status
;
106 unsigned long wxThread::GetID() const
111 bool wxThread::IsMain()
116 bool wxThread::IsAlive() const
121 void wxThread::SetPriority(int WXUNUSED(prio
)) { }
122 int wxThread::GetPriority() const { }
124 wxMutex wxMainMutex
; // controls access to all GUI functions
128 p_internal
= new wxThreadPrivate();
131 wxThread::~wxThread()
138 // The default callback just joins the thread and throws away the result.
139 void wxThread::OnExit()
145 // Automatic initialization
146 class wxThreadModule
: public wxModule
{
147 DECLARE_DYNAMIC_CLASS(wxThreadModule
)
153 bool wxThreadModule::OnInit() {
158 void wxThreadModule::wxThreadExit()
160 wxMainMutex
.Unlock();
163 IMPLEMENT_DYNAMIC_CLASS(wxThreadModule
, wxModule
)