mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-10 04:02:30 +00:00
* Fixed a race condition where the releasing of the global lock before calling polling would cause problems. Now a thread that acquires the global lock and wants to remove or change fd's from the main thread.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1182 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -70,7 +70,11 @@ PollManagerKQueue::poll(rak::timer timeout) {
|
||||
timeout = std::min(timeout, rak::timer(torrent::next_timeout())) + 1000;
|
||||
|
||||
ThreadBase::release_global_lock();
|
||||
ThreadBase::entering_main_polling();
|
||||
|
||||
int status = static_cast<torrent::PollKQueue*>(m_poll)->poll((timeout.usec() + 999) / 1000);
|
||||
|
||||
ThreadBase::leaving_main_polling();
|
||||
ThreadBase::acquire_global_lock();
|
||||
|
||||
if (status == -1)
|
||||
|
||||
Reference in New Issue
Block a user