diff --git a/rtt/extras/FileDescriptorActivity.cpp b/rtt/extras/FileDescriptorActivity.cpp index 98a3ece24..fe6bd77da 100644 --- a/rtt/extras/FileDescriptorActivity.cpp +++ b/rtt/extras/FileDescriptorActivity.cpp @@ -182,7 +182,7 @@ void FileDescriptorActivity::setTimeout_us(int timeout_us) } } void FileDescriptorActivity::watch(int fd) -{ RTT::os::MutexLock lock(m_lock); +{ RTT::os::MutexLock lock(m_fd_lock); if (fd < 0) { log(Error) << "negative file descriptor given to FileDescriptorActivity::watch" << endlog(); @@ -194,13 +194,13 @@ void FileDescriptorActivity::watch(int fd) triggerUpdateSets(); } void FileDescriptorActivity::unwatch(int fd) -{ RTT::os::MutexLock lock(m_lock); +{ RTT::os::MutexLock lock(m_fd_lock); m_watched_fds.erase(fd); FD_CLR(fd, &m_fd_set); triggerUpdateSets(); } void FileDescriptorActivity::clearAllWatches() -{ RTT::os::MutexLock lock(m_lock); +{ RTT::os::MutexLock lock(m_fd_lock); m_watched_fds.clear(); FD_ZERO(&m_fd_set); triggerUpdateSets(); @@ -226,7 +226,7 @@ bool FileDescriptorActivity::hasError() const bool FileDescriptorActivity::hasTimeout() const { return m_has_timeout; } bool FileDescriptorActivity::isWatched(int fd) const -{ RTT::os::MutexLock lock(m_lock); +{ RTT::os::MutexLock lock(m_fd_lock); return FD_ISSET(fd, &m_fd_set); } bool FileDescriptorActivity::start() @@ -308,7 +308,7 @@ void FileDescriptorActivity::loop() while(true) { int max_fd; - { RTT::os::MutexLock lock(m_lock); + { RTT::os::MutexLock lock(m_fd_lock); if (m_watched_fds.empty()) max_fd = pipe; else diff --git a/rtt/extras/FileDescriptorActivity.hpp b/rtt/extras/FileDescriptorActivity.hpp index 12a399a93..e7752e307 100644 --- a/rtt/extras/FileDescriptorActivity.hpp +++ b/rtt/extras/FileDescriptorActivity.hpp @@ -110,7 +110,7 @@ namespace RTT { namespace extras { int m_timeout_us; //! timeout in microseconds Seconds m_period; //! intended period /** Lock that protects the access to m_fd_set and m_watched_fds */ - mutable RTT::os::Mutex m_lock; + mutable RTT::os::Mutex m_fd_lock; fd_set m_fd_set; fd_set m_fd_work; bool m_has_error;