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

Cleanup header includes #309

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//////////////////////////////////////////////////////////////////////////////

#include <boost/bind/bind.hpp>
#include <boost/core/ref.hpp>

#include <boost/thread/detail/config.hpp>
#include <boost/thread/condition_variable.hpp>
Expand Down Expand Up @@ -187,7 +188,7 @@ namespace detail
template <class ValueType, class Queue>
bool sync_deque_base<ValueType, Queue>::wait_until_not_empty_or_closed(unique_lock<mutex>& lk)
{
cond_.wait(lk, boost::bind(&sync_deque_base<ValueType, Queue>::not_empty_or_closed, boost::ref(*this), boost::ref(lk)));
cond_.wait(lk, boost::bind(&sync_deque_base<ValueType, Queue>::not_empty_or_closed, this, boost::ref(lk)));
if (! empty(lk)) return false; // success
return true; // closed
}
Expand All @@ -196,7 +197,7 @@ namespace detail
template <class WClock, class Duration>
queue_op_status sync_deque_base<ValueType, Queue>::wait_until_not_empty_or_closed_until(unique_lock<mutex>& lk, chrono::time_point<WClock,Duration> const&tp)
{
if (! cond_.wait_until(lk, tp, boost::bind(&sync_deque_base<ValueType, Queue>::not_empty_or_closed, boost::ref(*this), boost::ref(lk))))
if (! cond_.wait_until(lk, tp, boost::bind(&sync_deque_base<ValueType, Queue>::not_empty_or_closed, this, boost::ref(lk))))
return queue_op_status::timeout;
if (! empty(lk)) return queue_op_status::success;
return queue_op_status::closed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//////////////////////////////////////////////////////////////////////////////

#include <boost/bind/bind.hpp>
#include <boost/core/ref.hpp>

#include <boost/thread/detail/config.hpp>
#include <boost/thread/condition_variable.hpp>
Expand Down Expand Up @@ -187,7 +188,7 @@ namespace detail
template <class ValueType, class Queue>
bool sync_queue_base<ValueType, Queue>::wait_until_not_empty_or_closed(unique_lock<mutex>& lk)
{
cond_.wait(lk, boost::bind(&sync_queue_base<ValueType, Queue>::not_empty_or_closed, boost::ref(*this), boost::ref(lk)));
cond_.wait(lk, boost::bind(&sync_queue_base<ValueType, Queue>::not_empty_or_closed, this, boost::ref(lk)));
if (! empty(lk)) return false; // success
return true; // closed
}
Expand All @@ -196,7 +197,7 @@ namespace detail
template <class WClock, class Duration>
queue_op_status sync_queue_base<ValueType, Queue>::wait_until_not_empty_or_closed_until(unique_lock<mutex>& lk, chrono::time_point<WClock,Duration> const&tp)
{
if (! cond_.wait_until(lk, tp, boost::bind(&sync_queue_base<ValueType, Queue>::not_empty_or_closed, boost::ref(*this), boost::ref(lk))))
if (! cond_.wait_until(lk, tp, boost::bind(&sync_queue_base<ValueType, Queue>::not_empty_or_closed, this, boost::ref(lk))))
return queue_op_status::timeout;
if (! empty(lk)) return queue_op_status::success;
return queue_op_status::closed;
Expand Down
3 changes: 2 additions & 1 deletion include/boost/thread/detail/thread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <algorithm>
#include <boost/core/ref.hpp>
#include <boost/cstdint.hpp>
#include <boost/bind/bind.hpp>
#include <stdlib.h>
#include <memory>
#include <boost/core/enable_if.hpp>
Expand All @@ -47,6 +46,8 @@

#if defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
#include <tuple>
#else
#include <boost/bind/bind.hpp>
#endif
#include <boost/config/abi_prefix.hpp>

Expand Down
10 changes: 5 additions & 5 deletions include/boost/thread/future.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ namespace boost
is_deferred_=false;
execute(lk);
}
waiters.wait(lk, boost::bind(&shared_state_base::is_done, boost::ref(*this)));
waiters.wait(lk, boost::bind(&shared_state_base::is_done, this));
if(rethrow && exception)
{
boost::rethrow_exception(exception);
Expand All @@ -420,7 +420,7 @@ namespace boost
return false;

do_callback(lock);
return waiters.timed_wait(lock, rel_time, boost::bind(&shared_state_base::is_done, boost::ref(*this)));
return waiters.timed_wait(lock, rel_time, boost::bind(&shared_state_base::is_done, this));
}

bool timed_wait_until(boost::system_time const& target_time)
Expand All @@ -430,7 +430,7 @@ namespace boost
return false;

do_callback(lock);
return waiters.timed_wait(lock, target_time, boost::bind(&shared_state_base::is_done, boost::ref(*this)));
return waiters.timed_wait(lock, target_time, boost::bind(&shared_state_base::is_done, this));
}
#endif
#ifdef BOOST_THREAD_USES_CHRONO
Expand All @@ -443,7 +443,7 @@ namespace boost
if (is_deferred_)
return future_status::deferred;
do_callback(lock);
if(!waiters.wait_until(lock, abs_time, boost::bind(&shared_state_base::is_done, boost::ref(*this))))
if(!waiters.wait_until(lock, abs_time, boost::bind(&shared_state_base::is_done, this)))
{
return future_status::timeout;
}
Expand Down Expand Up @@ -940,7 +940,7 @@ namespace boost
join();
#elif defined BOOST_THREAD_ASYNC_FUTURE_WAITS
unique_lock<boost::mutex> lk(this->mutex);
this->waiters.wait(lk, boost::bind(&shared_state_base::is_done, boost::ref(*this)));
this->waiters.wait(lk, boost::bind(&shared_state_base::is_done, this));
#endif
}

Expand Down
9 changes: 6 additions & 3 deletions include/boost/thread/pthread/once.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
#include <boost/thread/detail/delete.hpp>
#include <boost/core/no_exceptions_support.hpp>

#include <boost/bind/bind.hpp>
#include <boost/assert.hpp>
#include <boost/config/abi_prefix.hpp>

#include <boost/cstdint.hpp>
#include <pthread.h>
#include <csignal>

#if !defined(BOOST_THREAD_PROVIDES_INVOKE) && !defined(BOOST_THREAD_PROVIDES_INVOKE_RET)
#include <boost/bind/bind.hpp>
#endif

#include <boost/config/abi_prefix.hpp>

namespace boost
{

Expand Down
6 changes: 5 additions & 1 deletion include/boost/thread/pthread/once_atomic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
#include <boost/thread/detail/move.hpp>
#include <boost/thread/detail/invoke.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/atomic/capabilities.hpp>
#include <boost/atomic/atomic.hpp>

#if !defined(BOOST_THREAD_PROVIDES_INVOKE) && !defined(BOOST_THREAD_PROVIDES_INVOKE_RET)
#include <boost/bind/bind.hpp>
#include <boost/atomic.hpp>
#endif

#include <boost/config/abi_prefix.hpp>

Expand Down
32 changes: 16 additions & 16 deletions include/boost/thread/pthread/shared_mutex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb;
#endif
boost::unique_lock<boost::mutex> lk(state_change);
shared_cond.wait(lk, boost::bind(&state_data::can_lock_shared, boost::ref(state)));
shared_cond.wait(lk, boost::bind(&state_data::can_lock_shared, &state));
state.lock_shared();
}

Expand All @@ -194,7 +194,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb;
#endif
boost::unique_lock<boost::mutex> lk(state_change);
if(!shared_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock_shared, boost::ref(state))))
if(!shared_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock_shared, &state)))
{
return false;
}
Expand All @@ -209,7 +209,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb;
#endif
boost::unique_lock<boost::mutex> lk(state_change);
if(!shared_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock_shared, boost::ref(state))))
if(!shared_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock_shared, &state)))
{
return false;
}
Expand All @@ -230,7 +230,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb;
#endif
boost::unique_lock<boost::mutex> lk(state_change);
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_shared, boost::ref(state))))
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_shared, &state)))
{
return false;
}
Expand Down Expand Up @@ -270,7 +270,7 @@ namespace boost
#endif
boost::unique_lock<boost::mutex> lk(state_change);
state.exclusive_waiting_blocked=true;
exclusive_cond.wait(lk, boost::bind(&state_data::can_lock, boost::ref(state)));
exclusive_cond.wait(lk, boost::bind(&state_data::can_lock, &state));
state.exclusive=true;
}

Expand All @@ -282,7 +282,7 @@ namespace boost
#endif
boost::unique_lock<boost::mutex> lk(state_change);
state.exclusive_waiting_blocked=true;
if(!exclusive_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock, boost::ref(state))))
if(!exclusive_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock, &state)))
{
state.exclusive_waiting_blocked=false;
release_waiters();
Expand All @@ -300,7 +300,7 @@ namespace boost
#endif
boost::unique_lock<boost::mutex> lk(state_change);
state.exclusive_waiting_blocked=true;
if(!exclusive_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock, boost::ref(state))))
if(!exclusive_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock, &state)))
{
state.exclusive_waiting_blocked=false;
release_waiters();
Expand All @@ -324,7 +324,7 @@ namespace boost
#endif
boost::unique_lock<boost::mutex> lk(state_change);
state.exclusive_waiting_blocked=true;
if(!exclusive_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock, boost::ref(state))))
if(!exclusive_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock, &state)))
{
state.exclusive_waiting_blocked=false;
release_waiters();
Expand Down Expand Up @@ -362,7 +362,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb;
#endif
boost::unique_lock<boost::mutex> lk(state_change);
shared_cond.wait(lk, boost::bind(&state_data::can_lock_upgrade, boost::ref(state)));
shared_cond.wait(lk, boost::bind(&state_data::can_lock_upgrade, &state));
state.lock_shared();
state.upgrade=true;
}
Expand All @@ -374,7 +374,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb;
#endif
boost::unique_lock<boost::mutex> lk(state_change);
if(!shared_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock_upgrade, boost::ref(state))))
if(!shared_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock_upgrade, &state)))
{
return false;
}
Expand All @@ -390,7 +390,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb;
#endif
boost::unique_lock<boost::mutex> lk(state_change);
if(!shared_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock_upgrade, boost::ref(state))))
if(!shared_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock_upgrade, &state)))
{
return false;
}
Expand All @@ -412,7 +412,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb;
#endif
boost::unique_lock<boost::mutex> lk(state_change);
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_upgrade, boost::ref(state))))
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_upgrade, &state)))
{
return false;
}
Expand Down Expand Up @@ -457,7 +457,7 @@ namespace boost
boost::unique_lock<boost::mutex> lk(state_change);
state.assert_lock_upgraded();
state.unlock_shared();
upgrade_cond.wait(lk, boost::bind(&state_data::no_shared, boost::ref(state)));
upgrade_cond.wait(lk, boost::bind(&state_data::no_shared, &state));
state.upgrade=false;
state.exclusive=true;
state.assert_locked();
Expand Down Expand Up @@ -511,7 +511,7 @@ namespace boost
#endif
boost::unique_lock<boost::mutex> lk(state_change);
state.assert_lock_upgraded();
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::one_shared, boost::ref(state))))
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::one_shared, &state)))
{
return false;
}
Expand Down Expand Up @@ -569,7 +569,7 @@ namespace boost
#endif
boost::unique_lock<boost::mutex> lk(state_change);
state.assert_lock_shared();
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::one_shared, boost::ref(state))))
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::one_shared, &state)))
{
return false;
}
Expand Down Expand Up @@ -623,7 +623,7 @@ namespace boost
#endif
boost::unique_lock<boost::mutex> lk(state_change);
state.assert_lock_shared();
if(!exclusive_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_upgrade, boost::ref(state))))
if(!exclusive_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_upgrade, &state)))
{
return false;
}
Expand Down
Loading