- wxASSERT( ((!m_thread_waiter->IsAlive() || m_thread_waiter->IsPaused()) &&
- (!m_thread_requester->IsAlive() || m_thread_requester->IsPaused())));
-
- m_thread_waiter->m_fd = m_socket->m_fd;
- m_thread_requester->m_fd = m_socket->m_fd;
-
- if (m_thread_waiter->IsPaused())
- ResumeSocket();
- else {
- wxThreadError err;
-
- err = m_thread_waiter->Create();
- wxASSERT(err == wxTHREAD_NO_ERROR);
- err = m_thread_requester->Create();
- wxASSERT(err == wxTHREAD_NO_ERROR);
-
- err = m_thread_waiter->Run();
- wxASSERT(err == wxTHREAD_NO_ERROR);
- err = m_thread_requester->Run();
- wxASSERT(err == wxTHREAD_NO_ERROR);
+#if wxUSE_THREADS
+ wxThreadError err;
+
+ wxASSERT(m_invalid_requester);
+
+ m_end_requester.Lock();
+
+ if (m_thread_requester != NULL) {
+ m_thread_requester->Delete(); // We must join it.
+ delete m_thread_requester;