]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/threadno.cpp
572f91df81459226cd50ad26c7355ba2856eb093
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"
32 wxLogDebug( "wxMutex warning: destroying a locked mutex (%d locks)", m_locked
);
36 wxMutexError
wxMutex::Lock()
39 return wxMUTEX_NO_ERROR
;
42 wxMutexError
wxMutex::TryLock()
47 return wxMUTEX_NO_ERROR
;
50 wxMutexError
wxMutex::Unlock()
53 return wxMUTEX_UNLOCKED
;
55 return wxMUTEX_NO_ERROR
;
58 wxCondition::wxCondition()
62 wxCondition::~wxCondition()
66 void wxCondition::Wait(wxMutex
& WXUNUSED(mutex
))
70 bool wxCondition::Wait(wxMutex
& WXUNUSED(mutex
), unsigned long WXUNUSED(sec
),
71 unsigned long WXUNUSED(nsec
))
76 void wxCondition::Signal()
80 void wxCondition::Broadcast()
84 struct wxThreadInternal
90 wxThreadError
wxThread::Create()
92 p_internal
->exit_status
= Entry();
94 return wxTHREAD_NO_ERROR
;
97 wxThreadError
wxThread::Destroy()
99 return wxTHREAD_NOT_RUNNING
;
102 wxThreadError
wxThread::Pause()
104 return wxTHREAD_NOT_RUNNING
;
107 wxThreadError
wxThread::Resume()
109 return wxTHREAD_NOT_RUNNING
;
112 void wxThread::DeferDestroy( bool WXUNUSED(on
) )
116 void wxThread::TestDestroy()
120 void *wxThread::Join()
122 return p_internal
->exit_status
;
125 unsigned long wxThread::GetID() const
130 bool wxThread::IsMain()
135 bool wxThread::IsRunning() const
140 bool wxThread::IsAlive() const
145 void wxThread::SetPriority(int WXUNUSED(prio
)) { }
146 int wxThread::GetPriority() const { return 0; }
148 wxMutex
*wxMainMutex
; // controls access to all GUI functions
152 p_internal
= new wxThreadInternal();
155 wxThread::~wxThread()
162 // The default callback just joins the thread and throws away the result.
163 void wxThread::OnExit()
168 IMPLEMENT_DYNAMIC_CLASS(wxThreadModule
, wxModule
)
170 bool wxThreadModule::OnInit()
172 wxMainMutex
= new wxMutex();
177 void wxThreadModule::OnExit()
179 wxMainMutex
->Unlock();
185 void wxMutexGuiEnter()
189 void wxMutexGuiLeave()