* Finished the foundation of threading.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1114 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2009-12-15 21:39:35 +00:00
parent 6a94909647
commit 2304983f4f
6 changed files with 15 additions and 53 deletions
+6 -1
View File
@@ -45,6 +45,7 @@
#include <torrent/torrent.h>
#include "poll_manager_kqueue.h"
#include "thread_base.h"
namespace core {
@@ -68,7 +69,11 @@ PollManagerKQueue::poll(rak::timer timeout) {
torrent::perform();
timeout = std::min(timeout, rak::timer(torrent::next_timeout())) + 1000;
if (static_cast<torrent::PollKQueue*>(m_poll)->poll((timeout.usec() + 999) / 1000) == -1)
ThreadBase::release_global_lock();
int status = static_cast<torrent::PollKQueue*>(m_poll)->poll((timeout.usec() + 999) / 1000);
ThreadBase::acquire_global_lock();
if (status == -1)
return check_error();
torrent::perform();