]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/threadno.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk1/threadno.cpp
3 // Purpose: Solaris thread support
4 // Author: Guilhem Lavaux
8 // Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
15 #include "wx/thread.h"
20 #include "wx/module.h"
31 wxLogDebug( "wxMutex warning: destroying a locked mutex (%d locks)", m_locked
);
34 wxMutexError
wxMutex::Lock()
37 return wxMUTEX_NO_ERROR
;
40 wxMutexError
wxMutex::TryLock()
45 return wxMUTEX_NO_ERROR
;
48 wxMutexError
wxMutex::Unlock()
51 return wxMUTEX_UNLOCKED
;
53 return wxMUTEX_NO_ERROR
;
56 wxCondition::wxCondition()
60 wxCondition::~wxCondition()
64 void wxCondition::Wait(wxMutex
& WXUNUSED(mutex
))
68 bool wxCondition::Wait(wxMutex
& WXUNUSED(mutex
), unsigned long WXUNUSED(sec
),
69 unsigned long WXUNUSED(nsec
))
74 void wxCondition::Signal()
78 void wxCondition::Broadcast()
82 struct wxThreadInternal
88 wxThreadError
wxThread::Create()
90 p_internal
->exit_status
= Entry();
92 return wxTHREAD_NO_ERROR
;
95 wxThreadError
wxThread::Destroy()
97 return wxTHREAD_NOT_RUNNING
;
100 wxThreadError
wxThread::Pause()
102 return wxTHREAD_NOT_RUNNING
;
105 wxThreadError
wxThread::Resume()
107 return wxTHREAD_NOT_RUNNING
;
110 void wxThread::DeferDestroy( bool WXUNUSED(on
) )
114 void wxThread::TestDestroy()
118 void *wxThread::Join()
120 return p_internal
->exit_status
;
123 unsigned long wxThread::GetID() const
128 bool wxThread::IsMain()
133 bool wxThread::IsRunning() const
138 bool wxThread::IsAlive() const
143 void wxThread::SetPriority(int WXUNUSED(prio
)) { }
144 int wxThread::GetPriority() const { return 0; }
146 wxMutex
*wxMainMutex
; // controls access to all GUI functions
150 p_internal
= new wxThreadInternal();
153 wxThread::~wxThread()
160 // The default callback just joins the thread and throws away the result.
161 void wxThread::OnExit()
166 IMPLEMENT_DYNAMIC_CLASS(wxThreadModule
, wxModule
)
168 bool wxThreadModule::OnInit()
170 wxMainMutex
= new wxMutex();
175 void wxThreadModule::OnExit()
177 wxMainMutex
->Unlock();
183 void wxMutexGuiEnter()
187 void wxMutexGuiLeave()