|
Boost-Commit : |
From: anthony_at_[hidden]
Date: 2007-12-04 04:15:39
Author: anthonyw
Date: 2007-12-04 04:15:37 EST (Tue, 04 Dec 2007)
New Revision: 41681
URL: http://svn.boost.org/trac/boost/changeset/41681
Log:
changed boost::move to boost::detail::thread_move to fix issue #1492
Text files modified:
trunk/boost/thread/detail/move.hpp | 32 +++++++++++++++++-------------
trunk/boost/thread/locks.hpp | 42 ++++++++++++++++++++--------------------
trunk/boost/thread/pthread/thread.hpp | 12 +++++-----
trunk/boost/thread/win32/thread.hpp | 12 +++++-----
trunk/libs/thread/src/win32/thread.cpp | 10 ++++----
5 files changed, 56 insertions(+), 52 deletions(-)
Modified: trunk/boost/thread/detail/move.hpp
==============================================================================
--- trunk/boost/thread/detail/move.hpp (original)
+++ trunk/boost/thread/detail/move.hpp 2007-12-04 04:15:37 EST (Tue, 04 Dec 2007)
@@ -8,25 +8,29 @@
namespace boost
{
- template<typename T>
- struct move_t
+ namespace detail
{
- T& t;
- move_t(T& t_):
- t(t_)
- {}
+ template<typename T>
+ struct thread_move_t
+ {
+ T& t;
+ thread_move_t(T& t_):
+ t(t_)
+ {}
+
+ T* operator->() const
+ {
+ return &t;
+ }
+ };
- T* operator->() const
+ template<typename T>
+ thread_move_t<T> thread_move(T& t)
{
- return &t;
+ return thread_move_t<T>(t);
}
- };
-
- template<typename T>
- move_t<T> move(T& t)
- {
- return move_t<T>(t);
}
+
}
Modified: trunk/boost/thread/locks.hpp
==============================================================================
--- trunk/boost/thread/locks.hpp (original)
+++ trunk/boost/thread/locks.hpp 2007-12-04 04:15:37 EST (Tue, 04 Dec 2007)
@@ -86,21 +86,21 @@
{
timed_lock(target_time);
}
- unique_lock(boost::move_t<unique_lock<Mutex> > other):
+ unique_lock(detail::thread_move_t<unique_lock<Mutex> > other):
m(other->m),is_locked(other->is_locked)
{
other->is_locked=false;
}
- unique_lock(boost::move_t<upgrade_lock<Mutex> > other);
+ unique_lock(detail::thread_move_t<upgrade_lock<Mutex> > other);
- unique_lock& operator=(boost::move_t<unique_lock<Mutex> > other)
+ unique_lock& operator=(detail::thread_move_t<unique_lock<Mutex> > other)
{
unique_lock temp(other);
swap(temp);
return *this;
}
- unique_lock& operator=(boost::move_t<upgrade_lock<Mutex> > other)
+ unique_lock& operator=(detail::thread_move_t<upgrade_lock<Mutex> > other)
{
unique_lock temp(other);
swap(temp);
@@ -112,7 +112,7 @@
std::swap(m,other.m);
std::swap(is_locked,other.is_locked);
}
- void swap(boost::move_t<unique_lock<Mutex> > other)
+ void swap(detail::thread_move_t<unique_lock<Mutex> > other)
{
std::swap(m,other->m);
std::swap(is_locked,other->is_locked);
@@ -228,13 +228,13 @@
timed_lock(target_time);
}
- shared_lock(boost::move_t<shared_lock<Mutex> > other):
+ shared_lock(detail::thread_move_t<shared_lock<Mutex> > other):
m(other->m),is_locked(other->is_locked)
{
other->is_locked=false;
}
- shared_lock(boost::move_t<unique_lock<Mutex> > other):
+ shared_lock(detail::thread_move_t<unique_lock<Mutex> > other):
m(other->m),is_locked(other->is_locked)
{
other->is_locked=false;
@@ -244,7 +244,7 @@
}
}
- shared_lock(boost::move_t<upgrade_lock<Mutex> > other):
+ shared_lock(detail::thread_move_t<upgrade_lock<Mutex> > other):
m(other->m),is_locked(other->is_locked)
{
other->is_locked=false;
@@ -254,21 +254,21 @@
}
}
- shared_lock& operator=(boost::move_t<shared_lock<Mutex> > other)
+ shared_lock& operator=(detail::thread_move_t<shared_lock<Mutex> > other)
{
shared_lock temp(other);
swap(temp);
return *this;
}
- shared_lock& operator=(boost::move_t<unique_lock<Mutex> > other)
+ shared_lock& operator=(detail::thread_move_t<unique_lock<Mutex> > other)
{
shared_lock temp(other);
swap(temp);
return *this;
}
- shared_lock& operator=(boost::move_t<upgrade_lock<Mutex> > other)
+ shared_lock& operator=(detail::thread_move_t<upgrade_lock<Mutex> > other)
{
shared_lock temp(other);
swap(temp);
@@ -364,13 +364,13 @@
lock();
}
}
- upgrade_lock(boost::move_t<upgrade_lock<Mutex> > other):
+ upgrade_lock(detail::thread_move_t<upgrade_lock<Mutex> > other):
m(other->m),is_locked(other->is_locked)
{
other->is_locked=false;
}
- upgrade_lock(boost::move_t<unique_lock<Mutex> > other):
+ upgrade_lock(detail::thread_move_t<unique_lock<Mutex> > other):
m(other->m),is_locked(other->is_locked)
{
other->is_locked=false;
@@ -380,14 +380,14 @@
}
}
- upgrade_lock& operator=(boost::move_t<upgrade_lock<Mutex> > other)
+ upgrade_lock& operator=(detail::thread_move_t<upgrade_lock<Mutex> > other)
{
upgrade_lock temp(other);
swap(temp);
return *this;
}
- upgrade_lock& operator=(boost::move_t<unique_lock<Mutex> > other)
+ upgrade_lock& operator=(detail::thread_move_t<unique_lock<Mutex> > other)
{
upgrade_lock temp(other);
swap(temp);
@@ -453,7 +453,7 @@
};
template<typename Mutex>
- unique_lock<Mutex>::unique_lock(boost::move_t<upgrade_lock<Mutex> > other):
+ unique_lock<Mutex>::unique_lock(detail::thread_move_t<upgrade_lock<Mutex> > other):
m(other->m),is_locked(other->is_locked)
{
other->is_locked=false;
@@ -474,23 +474,23 @@
upgrade_to_unique_lock& operator=(upgrade_to_unique_lock&);
public:
explicit upgrade_to_unique_lock(upgrade_lock<Mutex>& m_):
- source(&m_),exclusive(boost::move(*source))
+ source(&m_),exclusive(detail::thread_move(*source))
{}
~upgrade_to_unique_lock()
{
if(source)
{
- *source=boost::move(exclusive);
+ *source=detail::thread_move(exclusive);
}
}
- upgrade_to_unique_lock(boost::move_t<upgrade_to_unique_lock<Mutex> > other):
- source(other->source),exclusive(boost::move(other->exclusive))
+ upgrade_to_unique_lock(detail::thread_move_t<upgrade_to_unique_lock<Mutex> > other):
+ source(other->source),exclusive(detail::thread_move(other->exclusive))
{
other->source=0;
}
- upgrade_to_unique_lock& operator=(boost::move_t<upgrade_to_unique_lock<Mutex> > other)
+ upgrade_to_unique_lock& operator=(detail::thread_move_t<upgrade_to_unique_lock<Mutex> > other)
{
upgrade_to_unique_lock temp(other);
swap(temp);
Modified: trunk/boost/thread/pthread/thread.hpp
==============================================================================
--- trunk/boost/thread/pthread/thread.hpp (original)
+++ trunk/boost/thread/pthread/thread.hpp 2007-12-04 04:15:37 EST (Tue, 04 Dec 2007)
@@ -97,7 +97,7 @@
thread_data(F f_):
f(f_)
{}
- thread_data(boost::move_t<F> f_):
+ thread_data(detail::thread_move_t<F> f_):
f(f_)
{}
@@ -127,16 +127,16 @@
start_thread();
}
template <class F>
- thread(boost::move_t<F> f):
+ thread(detail::thread_move_t<F> f):
thread_info(new thread_data<F>(f))
{
start_thread();
}
- explicit thread(boost::move_t<thread> x);
- thread& operator=(boost::move_t<thread> x);
- operator boost::move_t<thread>();
- boost::move_t<thread> move();
+ explicit thread(detail::thread_move_t<thread> x);
+ thread& operator=(detail::thread_move_t<thread> x);
+ operator detail::thread_move_t<thread>();
+ detail::thread_move_t<thread> move();
void swap(thread& x);
Modified: trunk/boost/thread/win32/thread.hpp
==============================================================================
--- trunk/boost/thread/win32/thread.hpp (original)
+++ trunk/boost/thread/win32/thread.hpp 2007-12-04 04:15:37 EST (Tue, 04 Dec 2007)
@@ -169,7 +169,7 @@
thread_data(F f_):
f(f_)
{}
- thread_data(boost::move_t<F> f_):
+ thread_data(detail::thread_move_t<F> f_):
f(f_)
{}
@@ -200,16 +200,16 @@
start_thread();
}
template <class F>
- explicit thread(boost::move_t<F> f):
+ explicit thread(detail::thread_move_t<F> f):
thread_info(detail::heap_new<thread_data<F> >(f))
{
start_thread();
}
- thread(boost::move_t<thread> x);
- thread& operator=(boost::move_t<thread> x);
- operator boost::move_t<thread>();
- boost::move_t<thread> move();
+ thread(detail::thread_move_t<thread> x);
+ thread& operator=(detail::thread_move_t<thread> x);
+ operator detail::thread_move_t<thread>();
+ detail::thread_move_t<thread> move();
void swap(thread& x);
Modified: trunk/libs/thread/src/win32/thread.cpp
==============================================================================
--- trunk/libs/thread/src/win32/thread.cpp (original)
+++ trunk/libs/thread/src/win32/thread.cpp 2007-12-04 04:15:37 EST (Tue, 04 Dec 2007)
@@ -244,7 +244,7 @@
detach();
}
- thread::thread(boost::move_t<thread> x)
+ thread::thread(detail::thread_move_t<thread> x)
{
{
boost::mutex::scoped_lock l(x->thread_info_mutex);
@@ -253,21 +253,21 @@
x->release_handle();
}
- thread& thread::operator=(boost::move_t<thread> x)
+ thread& thread::operator=(detail::thread_move_t<thread> x)
{
thread new_thread(x);
swap(new_thread);
return *this;
}
- thread::operator boost::move_t<thread>()
+ thread::operator detail::thread_move_t<thread>()
{
return move();
}
- boost::move_t<thread> thread::move()
+ detail::thread_move_t<thread> thread::move()
{
- boost::move_t<thread> x(*this);
+ detail::thread_move_t<thread> x(*this);
return x;
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk