Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error: ‘reverse_lock’ is not a member of ‘boost’ #95

Merged
merged 1 commit into from
Jan 31, 2018

Conversation

rhaschke
Copy link
Contributor

Obviously a recent change in boost, makes actionlib fail due to a missing boost include:

/opt/ros/kinetic/include/actionlib/server/action_server_base.h: In member function ‘void actionlib::ActionServerBase<ActionSpec>::goalCallback(const boost::shared_ptr<const typename ActionSpec::_action_goal_type>&)’:
/opt/ros/kinetic/include/actionlib/server/action_server_base.h:256:5: error: ‘reverse_lock’ is not a member of ‘boost’
     boost::reverse_lock<boost::recursive_mutex::scoped_lock> unlocker(lock);

This PR adds the missing include, which is definitely not part of any standard boost include anymore:

$ grep -r reverse_lock /usr/include/boost/thread
/usr/include/boost/thread/reverse_lock.hpp:    class reverse_lock
/usr/include/boost/thread/reverse_lock.hpp:        BOOST_THREAD_NO_COPYABLE(reverse_lock)
/usr/include/boost/thread/reverse_lock.hpp:        explicit reverse_lock(Lock& m_)
/usr/include/boost/thread/reverse_lock.hpp:        ~reverse_lock()
/usr/include/boost/thread/reverse_lock.hpp:    struct is_mutex_type<reverse_lock<T> >

@mikaelarguedas
Copy link
Member

thanks @rhaschke for catching this.

I think it's actually a recent change in actionlib that introduced that error, looking at boost's history it doesnt look like reverse_lock was included in thread.hpp in previous boost versions either. I guess we didnt catch it earlier because no one was using the action_server_base.h directly but the action_server.h instead. Is that the scenario in which you faced this issue ?

@rhaschke
Copy link
Contributor Author

Indeed we face the mentioned use case. I was suprised that we didn't catch this error earlier. Obviously the corresponding libs weren't rebuilt for a while.

@mikaelarguedas
Copy link
Member

thanks @rhaschke
I'm going to merge this and audit the other files to make sure we "include what we use"

@mikaelarguedas mikaelarguedas merged commit fc06865 into ros:indigo-devel Jan 31, 2018
guihomework added a commit to ubi-agni/orocos_controllers that referenced this pull request Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants