Task Scheduler, log viewer pops up and disapperes. good good

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@308 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-02-26 21:58:59 +00:00
parent 9fe97ee490
commit ef3a8fcd83
15 changed files with 221 additions and 49 deletions
+4 -8
View File
@@ -13,7 +13,7 @@
namespace core {
void
Poll::poll() {
Poll::poll(utils::Timer timeout) {
FD_ZERO(m_readSet);
FD_ZERO(m_writeSet);
FD_ZERO(m_exceptSet);
@@ -29,15 +29,11 @@ Poll::poll() {
m_maxFd = std::max(m_maxFd, n);
}
uint64_t t = torrent::get(torrent::TIME_SELECT);
if (t > 1000000)
t = 1000000;
timeval timeout = {t / 1000000, t % 1000000};
timeout = std::min(timeout, utils::Timer(torrent::get(torrent::TIME_SELECT)));
timeval t = timeout.tval();
errno = 0;
m_maxFd = select(m_maxFd + 1, m_readSet, m_writeSet, m_exceptSet, &timeout);
m_maxFd = select(m_maxFd + 1, m_readSet, m_writeSet, m_exceptSet, &t);
if (m_maxFd >= 0) {
work();