]>
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"
26 MutexError
wxMutex::Lock()
32 MutexError
wxMutex::TryLock()
38 MutexError
wxMutex::Unlock()
44 wxCondition::wxCondition()
48 wxCondition::~wxCondition()
52 void wxCondition::Wait(wxMutex
& WXUNUSED(mutex
))
56 bool wxCondition::Wait(wxMutex
& WXUNUSED(mutex
), unsigned long WXUNUSED(sec
),
57 unsigned long WXUNUSED(nsec
))
62 void wxCondition::Signal()
66 void wxCondition::Broadcast()
70 struct wxThreadPrivate
{
75 ThreadError
wxThread::Create()
77 p_internal
->exit_status
= Entry();
82 ThreadError
wxThread::Destroy()
87 void wxThread::DeferDestroy()
91 void wxThread::TestDestroy()
95 void *wxThread::Join()
97 return p_internal
->exit_status
;
100 unsigned long wxThread::GetID() const
105 bool wxThread::IsMain()
110 bool wxThread::IsAlive() const
115 void wxThread::SetPriority(int WXUNUSED(prio
)) { }
116 int wxThread::GetPriority() const { }
118 wxMutex wxMainMutex
; // controls access to all GUI functions
122 p_internal
= new wxThreadPrivate();
125 wxThread::~wxThread()
132 // The default callback just joins the thread and throws away the result.
133 void wxThread::OnExit()
138 // Global initialization
139 static void wxThreadInit(void *WXUNUSED(client
))
145 static void wxThreadExit(void *WXUNUSED(client
))
147 wxMainMutex
.Unlock();
150 // Let automatic initialization be performed from wxCommonInit().
154 wxRegisterModuleFunction(wxThreadInit
, wxThreadExit
, NULL
);