コード例 #1
0
void SearchThread::DeleteThread() {
    // We may be waiting for the condition so we cannot just call Delete
    m_stopSearch = true;
    CancelSearch();

    // Signal thread to stop waiting
    wxMutexLocker lock(m_condMutex);
    m_startSearchCond.Signal();
}
コード例 #2
0
void SearchThread::StartSearch(const wxString& path, const wxString& pattern, bool matchCase, bool regex) {
    m_path = path;
    m_pattern = pattern.c_str(); // wxString is not threadsafe, so we have to force copy
    m_matchCase = matchCase;
    m_regex = regex;
    m_lastError = false;

    // Signal thread that we should start search
    wxMutexLocker lock(m_condMutex);
    m_startSearchCond.Signal();
}
コード例 #3
0
ファイル: threadpsx.cpp プロジェクト: czxxjtu/wxPython-1
wxSemaError wxSemaphoreInternal::Post()
{
    wxMutexLocker locker(m_mutex);

    if ( m_maxcount > 0 && m_count == m_maxcount )
    {
        return wxSEMA_OVERFLOW;
    }

    m_count++;

    wxLogTrace(TRACE_SEMA,
               _T("Thread %ld about to signal semaphore, count = %lu"),
               wxThread::GetCurrentId(), (unsigned long)m_count);

    return m_cond.Signal() == wxCOND_NO_ERROR ? wxSEMA_NO_ERROR
                                              : wxSEMA_MISC_ERROR;
}