]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/threadno.cpp
1 /////////////////////////////////////////////////////////////////////////////
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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13 #pragma implementation "thread.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
20 #include "wx/module.h"
21 #include "wx/thread.h"
32 wxLogDebug( "wxMutex warning: destroying a locked mutex (%d locks)", m_locked
);
35 wxMutexError
wxMutex::Lock()
38 return wxMUTEX_NO_ERROR
;
41 wxMutexError
wxMutex::TryLock()
46 return wxMUTEX_NO_ERROR
;
49 wxMutexError
wxMutex::Unlock()
52 return wxMUTEX_UNLOCKED
;
54 return wxMUTEX_NO_ERROR
;
57 wxCondition::wxCondition()
61 wxCondition::~wxCondition()
65 void wxCondition::Wait(wxMutex
& WXUNUSED(mutex
))
69 bool wxCondition::Wait(wxMutex
& WXUNUSED(mutex
), unsigned long WXUNUSED(sec
),
70 unsigned long WXUNUSED(nsec
))
75 void wxCondition::Signal()
79 void wxCondition::Broadcast()
83 struct wxThreadInternal
89 wxThreadError
wxThread::Create()
91 p_internal
->exit_status
= Entry();
93 return wxTHREAD_NO_ERROR
;
96 wxThreadError
wxThread::Destroy()
98 return wxTHREAD_NOT_RUNNING
;
101 wxThreadError
wxThread::Pause()
103 return wxTHREAD_NOT_RUNNING
;
106 wxThreadError
wxThread::Resume()
108 return wxTHREAD_NOT_RUNNING
;
111 void wxThread::DeferDestroy( bool WXUNUSED(on
) )
115 void wxThread::TestDestroy()
119 void *wxThread::Join()
121 return p_internal
->exit_status
;
124 unsigned long wxThread::GetID() const
129 bool wxThread::IsMain()
134 bool wxThread::IsRunning() const
139 bool wxThread::IsAlive() const
144 void wxThread::SetPriority(int WXUNUSED(prio
)) { }
145 int wxThread::GetPriority() const { return 0; }
147 wxMutex
*wxMainMutex
; // controls access to all GUI functions
151 p_internal
= new wxThreadInternal();
154 wxThread::~wxThread()
161 // The default callback just joins the thread and throws away the result.
162 void wxThread::OnExit()
167 IMPLEMENT_DYNAMIC_CLASS(wxThreadModule
, wxModule
)
169 bool wxThreadModule::OnInit()
171 wxMainMutex
= new wxMutex();
176 void wxThreadModule::OnExit()
178 wxMainMutex
->Unlock();
184 void wxMutexGuiEnter()
188 void wxMutexGuiLeave()