static const wxThread::ExitCode EXITCODE_CANCELLED = (wxThread::ExitCode)-1;
// trace mask for wxThread operations
static const wxThread::ExitCode EXITCODE_CANCELLED = (wxThread::ExitCode)-1;
// trace mask for wxThread operations
case EDEADLK:
// only error checking mutexes return this value and so it's an
// unexpected situation -- hence use assert, not wxLogDebug
case EDEADLK:
// only error checking mutexes return this value and so it's an
// unexpected situation -- hence use assert, not wxLogDebug
wxThread::GetCurrentId());
if ( m_cond.Wait() != wxCOND_NO_ERROR )
return wxSEMA_MISC_ERROR;
wxLogTrace(TRACE_SEMA,
wxThread::GetCurrentId());
if ( m_cond.Wait() != wxCOND_NO_ERROR )
return wxSEMA_MISC_ERROR;
wxLogTrace(TRACE_SEMA,
wxThread::GetCurrentId(), (unsigned long)m_count);
return m_cond.Signal() == wxCOND_NO_ERROR ? wxSEMA_NO_ERROR
wxThread::GetCurrentId(), (unsigned long)m_count);
return m_cond.Signal() == wxCOND_NO_ERROR ? wxSEMA_NO_ERROR
GetId(), stateNames[m_state], stateNames[state]);
#endif // wxUSE_LOG_TRACE
GetId(), stateNames[m_state], stateNames[state]);
#endif // wxUSE_LOG_TRACE
pthread->m_exitcode = thread->Entry();
wxLogTrace(TRACE_THREADS,
pthread->m_exitcode = thread->Entry();
wxLogTrace(TRACE_THREADS,
THR_ID(pthread), wxPtrToUInt(pthread->m_exitcode));
}
wxCATCH_ALL( wxTheApp->OnUnhandledException(); )
THR_ID(pthread), wxPtrToUInt(pthread->m_exitcode));
}
wxCATCH_ALL( wxTheApp->OnUnhandledException(); )
// if the thread we're waiting for is waiting for the GUI mutex, we will
// deadlock so make sure we release it temporarily
// if the thread we're waiting for is waiting for the GUI mutex, we will
// deadlock so make sure we release it temporarily
wxT("thread must first be paused with wxThread::Pause().") );
wxLogTrace(TRACE_THREADS,
wxT("thread must first be paused with wxThread::Pause().") );
wxLogTrace(TRACE_THREADS,
}
sp.sched_priority = min_prio + (prio*(max_prio - min_prio))/100;
if ( pthread_attr_setschedparam(&attr, &sp) != 0 )
{
}
sp.sched_priority = min_prio + (prio*(max_prio - min_prio))/100;
if ( pthread_attr_setschedparam(&attr, &sp) != 0 )
{
// this will make the threads created by this process really concurrent
if ( pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) != 0 )
{
// this will make the threads created by this process really concurrent
if ( pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) != 0 )
{
wxThreadError wxThread::Pause()
{
wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR,
wxThreadError wxThread::Pause()
{
wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR,
wxThreadError wxThread::Resume()
{
wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR,
wxThreadError wxThread::Resume()
{
wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR,
- wxLogTrace(TRACE_THREADS, _T("Thread %p suspended, resuming."),
+ wxLogTrace(TRACE_THREADS, wxT("Thread %p suspended, resuming."),
- wxLogTrace(TRACE_THREADS, _T("Thread %p exited, won't resume."),
+ wxLogTrace(TRACE_THREADS, wxT("Thread %p exited, won't resume."),
wxThread::ExitCode wxThread::Wait()
{
wxCHECK_MSG( This() != this, (ExitCode)-1,
wxThread::ExitCode wxThread::Wait()
{
wxCHECK_MSG( This() != this, (ExitCode)-1,
wxThreadError wxThread::Delete(ExitCode *rc)
{
wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR,
wxThreadError wxThread::Delete(ExitCode *rc)
{
wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR,
wxThreadError wxThread::Kill()
{
wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR,
wxThreadError wxThread::Kill()
{
wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR,
void wxThread::Exit(ExitCode status)
{
wxASSERT_MSG( This() == this,
void wxThread::Exit(ExitCode status)
{
wxASSERT_MSG( This() == this,
}
// also test whether we were paused
bool wxThread::TestDestroy()
{
wxASSERT_MSG( This() == this,
}
// also test whether we were paused
bool wxThread::TestDestroy()
{
wxASSERT_MSG( This() == this,
if ( nThreadsBeingDeleted > 0 )
{
wxLogTrace(TRACE_THREADS,
if ( nThreadsBeingDeleted > 0 )
{
wxLogTrace(TRACE_THREADS,