* More work on threading.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1112 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2009-12-12 21:30:52 +00:00
parent ef6e4deca9
commit b635f8c852
15 changed files with 278 additions and 48 deletions
+9 -9
View File
@@ -75,9 +75,9 @@ SCgiTask::open(SCgi* parent, int fd) {
m_position = m_buffer;
m_body = NULL;
this_thread->poll()->open(this);
this_thread->poll()->insert_read(this);
this_thread->poll()->insert_error(this);
main_thread->poll()->open(this);
main_thread->poll()->insert_read(this);
main_thread->poll()->insert_error(this);
// scgiTimer = rak::timer::current();
}
@@ -87,10 +87,10 @@ SCgiTask::close() {
if (!get_fd().is_valid())
return;
this_thread->poll()->remove_read(this);
this_thread->poll()->remove_write(this);
this_thread->poll()->remove_error(this);
this_thread->poll()->close(this);
main_thread->poll()->remove_read(this);
main_thread->poll()->remove_write(this);
main_thread->poll()->remove_error(this);
main_thread->poll()->close(this);
get_fd().close();
get_fd().clear();
@@ -171,8 +171,8 @@ SCgiTask::event_read() {
if ((unsigned int)std::distance(m_buffer, m_position) != m_bufferSize)
return;
this_thread->poll()->remove_read(this);
this_thread->poll()->insert_write(this);
main_thread->poll()->remove_read(this);
main_thread->poll()->insert_write(this);
if (m_parent->log_fd() >= 0) {
// Clean up logging, this is just plain ugly...