|
Boost-Commit : |
From: anthony_at_[hidden]
Date: 2008-03-21 11:04:12
Author: anthonyw
Date: 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
New Revision: 43743
URL: http://svn.boost.org/trac/boost/changeset/43743
Log:
Imported revision #43730 from trunk to eliminate some warnings
Text files modified:
branches/release/boost/thread/detail/move.hpp | 2
branches/release/boost/thread/pthread/shared_mutex.hpp | 49 +++++++++++++++++
branches/release/boost/thread/pthread/thread.hpp | 17 +++++
branches/release/boost/thread/pthread/thread_data.hpp | 1
branches/release/boost/thread/win32/basic_timed_mutex.hpp | 22 +++++++
branches/release/boost/thread/win32/condition_variable.hpp | 13 +++
branches/release/boost/thread/win32/once.hpp | 2
branches/release/boost/thread/win32/shared_mutex.hpp | 114 +++++++++++++++++++++++++++++++++++++++
branches/release/boost/thread/win32/thread.hpp | 19 +++++-
branches/release/libs/thread/src/pthread/thread.cpp | 2
branches/release/libs/thread/src/win32/tss_pe.cpp | 9 ++
branches/release/libs/thread/test/condition_test_common.hpp | 2
branches/release/libs/thread/test/shared_mutex_locking_thread.hpp | 8 ++
branches/release/libs/thread/test/test_condition.cpp | 3 +
branches/release/libs/thread/test/test_shared_mutex_part_2.cpp | 4 +
branches/release/libs/thread/test/test_tss.cpp | 2
branches/release/libs/thread/test/util.inl | 5 +
17 files changed, 261 insertions(+), 13 deletions(-)
Modified: branches/release/boost/thread/detail/move.hpp
==============================================================================
--- branches/release/boost/thread/detail/move.hpp (original)
+++ branches/release/boost/thread/detail/move.hpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -22,6 +22,8 @@
{
return &t;
}
+ private:
+ void operator=(thread_move_t&);
};
}
Modified: branches/release/boost/thread/pthread/shared_mutex.hpp
==============================================================================
--- branches/release/boost/thread/pthread/shared_mutex.hpp (original)
+++ branches/release/boost/thread/pthread/shared_mutex.hpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -57,7 +57,14 @@
boost::this_thread::disable_interruption do_not_disturb;
boost::mutex::scoped_lock lock(state_change);
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true)
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
{
if(!state.exclusive && !state.exclusive_waiting_blocked)
{
@@ -89,7 +96,14 @@
boost::this_thread::disable_interruption do_not_disturb;
boost::mutex::scoped_lock lock(state_change);
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true)
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
{
if(!state.exclusive && !state.exclusive_waiting_blocked)
{
@@ -130,7 +144,14 @@
boost::this_thread::disable_interruption do_not_disturb;
boost::mutex::scoped_lock lock(state_change);
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true)
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
{
if(state.shared_count || state.exclusive)
{
@@ -150,7 +171,14 @@
boost::this_thread::disable_interruption do_not_disturb;
boost::mutex::scoped_lock lock(state_change);
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true)
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
{
if(state.shared_count || state.exclusive)
{
@@ -196,7 +224,14 @@
{
boost::this_thread::disable_interruption do_not_disturb;
boost::mutex::scoped_lock lock(state_change);
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true)
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
{
if(!state.exclusive && !state.exclusive_waiting_blocked && !state.upgrade)
{
@@ -213,7 +248,14 @@
{
boost::this_thread::disable_interruption do_not_disturb;
boost::mutex::scoped_lock lock(state_change);
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true)
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
{
if(!state.exclusive && !state.exclusive_waiting_blocked && !state.upgrade)
{
@@ -262,7 +304,14 @@
boost::this_thread::disable_interruption do_not_disturb;
boost::mutex::scoped_lock lock(state_change);
--state.shared_count;
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true)
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
{
if(!state.shared_count)
{
Modified: branches/release/boost/thread/pthread/thread.hpp
==============================================================================
--- branches/release/boost/thread/pthread/thread.hpp (original)
+++ branches/release/boost/thread/pthread/thread.hpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -21,6 +21,12 @@
#include <boost/thread/detail/move.hpp>
#include <boost/shared_ptr.hpp>
#include "thread_data.hpp"
+#include <stdlib.h>
+
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
namespace boost
{
@@ -293,7 +299,7 @@
}
}
- class BOOST_THREAD_DECL thread_group : private noncopyable
+ class BOOST_THREAD_DECL thread_group
{
public:
thread_group();
@@ -304,13 +310,20 @@
void remove_thread(thread* thrd);
void join_all();
void interrupt_all();
- int size() const;
+ size_t size() const;
private:
+ thread_group(thread_group&);
+ void operator=(thread_group&);
+
std::list<thread*> m_threads;
mutex m_mutex;
};
} // namespace boost
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
#endif
Modified: branches/release/boost/thread/pthread/thread_data.hpp
==============================================================================
--- branches/release/boost/thread/pthread/thread_data.hpp (original)
+++ branches/release/boost/thread/pthread/thread_data.hpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -72,6 +72,7 @@
}
}
+ void operator=(interruption_checker&);
public:
explicit interruption_checker(pthread_cond_t* cond):
thread_info(detail::get_current_thread_data())
Modified: branches/release/boost/thread/win32/basic_timed_mutex.hpp
==============================================================================
--- branches/release/boost/thread/win32/basic_timed_mutex.hpp (original)
+++ branches/release/boost/thread/win32/basic_timed_mutex.hpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -33,7 +33,14 @@
void destroy()
{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4312)
+#endif
void* const old_event=BOOST_INTERLOCKED_EXCHANGE_POINTER(&event,0);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
if(old_event)
{
win32::CloseHandle(old_event);
@@ -64,7 +71,14 @@
bool timed_lock(::boost::system_time const& wait_until)
{
long old_count=active_count;
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true)
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
{
long const current_count=BOOST_INTERLOCKED_COMPARE_EXCHANGE(&active_count,(old_count+1)|lock_flag_value,old_count);
if(current_count==old_count)
@@ -139,7 +153,15 @@
if(!current_event)
{
void* const new_event=win32::create_anonymous_event(win32::auto_reset_event,win32::event_initially_reset);
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4311)
+#pragma warning(disable:4312)
+#endif
void* const old_event=BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(&event,new_event,0);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
if(old_event!=0)
{
win32::CloseHandle(new_event);
Modified: branches/release/boost/thread/win32/condition_variable.hpp
==============================================================================
--- branches/release/boost/thread/win32/condition_variable.hpp (original)
+++ branches/release/boost/thread/win32/condition_variable.hpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -55,10 +55,17 @@
}
else
{
- active_generation_count=(last_active_entry-generations)+1;
+ active_generation_count=unsigned(last_active_entry-generations)+1;
}
-
+
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4996)
+#endif
std::copy_backward(generations,generations+active_generation_count-1,generations+active_generation_count);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
generations[0]=list_entry();
}
@@ -108,6 +115,8 @@
}
}
+ private:
+ void operator=(relocker&);
};
Modified: branches/release/boost/thread/win32/once.hpp
==============================================================================
--- branches/release/boost/thread/win32/once.hpp (original)
+++ branches/release/boost/thread/win32/once.hpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -46,6 +46,8 @@
{
BOOST_VERIFY(win32::ReleaseMutex(mutex_handle)!=0);
}
+ private:
+ void operator=(win32_mutex_scoped_lock&);
};
#ifdef BOOST_NO_ANSI_APIS
Modified: branches/release/boost/thread/win32/shared_mutex.hpp
==============================================================================
--- branches/release/boost/thread/win32/shared_mutex.hpp (original)
+++ branches/release/boost/thread/win32/shared_mutex.hpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -1,7 +1,7 @@
#ifndef BOOST_THREAD_WIN32_SHARED_MUTEX_HPP
#define BOOST_THREAD_WIN32_SHARED_MUTEX_HPP
-// (C) Copyright 2006-7 Anthony Williams
+// (C) Copyright 2006-8 Anthony Williams
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -104,7 +104,14 @@
}
old_state=current_state;
}
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
return !(old_state.exclusive| old_state.exclusive_waiting_blocked);
}
@@ -115,7 +122,14 @@
bool timed_lock_shared(boost::system_time const& wait_until)
{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true)
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
{
state_data old_state=state;
do
@@ -137,7 +151,14 @@
}
old_state=current_state;
}
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
if(!(old_state.exclusive| old_state.exclusive_waiting_blocked))
{
@@ -169,7 +190,14 @@
}
old_state=current_state;
}
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
if(!(old_state.exclusive| old_state.exclusive_waiting_blocked))
{
@@ -226,7 +254,14 @@
}
old_state=current_state;
}
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
}
void lock()
@@ -236,7 +271,14 @@
bool timed_lock(boost::system_time const& wait_until)
{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true)
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
{
state_data old_state=state;
@@ -260,7 +302,14 @@
}
old_state=current_state;
}
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
if(!old_state.shared_count && !old_state.exclusive)
{
@@ -291,7 +340,14 @@
}
old_state=current_state;
}
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
if(!old_state.shared_count && !old_state.exclusive)
{
return true;
@@ -323,13 +379,27 @@
}
old_state=current_state;
}
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
release_waiters(old_state);
}
void lock_upgrade()
{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true)
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
{
state_data old_state=state;
do
@@ -352,7 +422,14 @@
}
old_state=current_state;
}
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
if(!(old_state.exclusive|| old_state.exclusive_waiting_blocked|| old_state.upgrade))
{
@@ -393,7 +470,14 @@
}
old_state=current_state;
}
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
}
void unlock_upgrade_and_lock()
@@ -421,7 +505,14 @@
}
old_state=current_state;
}
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
}
void unlock_and_lock_upgrade()
@@ -447,7 +538,14 @@
}
old_state=current_state;
}
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
release_waiters(old_state);
}
@@ -473,7 +571,14 @@
}
old_state=current_state;
}
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
release_waiters(old_state);
}
@@ -498,7 +603,14 @@
}
old_state=current_state;
}
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
release_waiters(old_state);
}
Modified: branches/release/boost/thread/win32/thread.hpp
==============================================================================
--- branches/release/boost/thread/win32/thread.hpp (original)
+++ branches/release/boost/thread/win32/thread.hpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -20,6 +20,13 @@
#include <algorithm>
#include <boost/ref.hpp>
#include <boost/cstdint.hpp>
+#include <stdlib.h>
+#include <memory>
+
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
namespace boost
{
@@ -450,9 +457,9 @@
thread* create_thread(F threadfunc)
{
boost::lock_guard<mutex> guard(m);
- thread* const new_thread=new thread(threadfunc);
- threads.push_back(new_thread);
- return new_thread;
+ std::auto_ptr<thread> new_thread(new thread(threadfunc));
+ threads.push_back(new_thread.get());
+ return new_thread.release();
}
void add_thread(thread* thrd)
@@ -498,7 +505,7 @@
}
}
- int size() const
+ size_t size() const
{
boost::lock_guard<mutex> guard(m);
return threads.size();
@@ -510,4 +517,8 @@
};
}
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
#endif
Modified: branches/release/libs/thread/src/pthread/thread.cpp
==============================================================================
--- branches/release/libs/thread/src/pthread/thread.cpp (original)
+++ branches/release/libs/thread/src/pthread/thread.cpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -683,7 +683,7 @@
}
- int thread_group::size() const
+ size_t thread_group::size() const
{
return m_threads.size();
}
Modified: branches/release/libs/thread/src/win32/tss_pe.cpp
==============================================================================
--- branches/release/libs/thread/src/win32/tss_pe.cpp (original)
+++ branches/release/libs/thread/src/win32/tss_pe.cpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -164,6 +164,10 @@
#endif
#endif
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4189)
+#endif
PVAPI on_tls_prepare(void)
{
//The following line has an important side effect:
@@ -201,6 +205,9 @@
return INIRETSUCCESS;
}
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
PVAPI on_process_init(void)
{
@@ -228,7 +235,7 @@
return INIRETSUCCESS;
}
- void NTAPI on_tls_callback(HINSTANCE h, DWORD dwReason, PVOID pv)
+ void NTAPI on_tls_callback(HINSTANCE /*h*/, DWORD dwReason, PVOID /*pv*/)
{
switch (dwReason)
{
Modified: branches/release/libs/thread/test/condition_test_common.hpp
==============================================================================
--- branches/release/libs/thread/test/condition_test_common.hpp (original)
+++ branches/release/libs/thread/test/condition_test_common.hpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -34,6 +34,8 @@
{
return flag;
}
+ private:
+ void operator=(check_flag&);
};
Modified: branches/release/libs/thread/test/shared_mutex_locking_thread.hpp
==============================================================================
--- branches/release/libs/thread/test/shared_mutex_locking_thread.hpp (original)
+++ branches/release/libs/thread/test/shared_mutex_locking_thread.hpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -1,6 +1,12 @@
#ifndef SHARED_MUTEX_LOCKING_THREAD_HPP
#define SHARED_MUTEX_LOCKING_THREAD_HPP
+// (C) Copyright 2008 Anthony Williams
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
#include <boost/thread/shared_mutex.hpp>
@@ -56,6 +62,8 @@
--simultaneous_running_count;
}
}
+private:
+ void operator=(locking_thread&);
};
Modified: branches/release/libs/thread/test/test_condition.cpp
==============================================================================
--- branches/release/libs/thread/test/test_condition.cpp (original)
+++ branches/release/libs/thread/test/test_condition.cpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -43,6 +43,9 @@
int& _var;
int _val;
+private:
+ void operator=(cond_predicate&);
+
};
void condition_test_waits(condition_test_data* data)
Modified: branches/release/libs/thread/test/test_shared_mutex_part_2.cpp
==============================================================================
--- branches/release/libs/thread/test/test_shared_mutex_part_2.cpp (original)
+++ branches/release/libs/thread/test/test_shared_mutex_part_2.cpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -116,6 +116,8 @@
boost::mutex& unblocked_mutex;
unsigned& unblocked_count;
+ void operator=(simple_writing_thread&);
+
public:
simple_writing_thread(boost::shared_mutex& rwm_,
boost::mutex& finish_mutex_,
@@ -182,6 +184,8 @@
boost::mutex& unblocked_mutex;
unsigned& unblocked_count;
+ void operator=(simple_reading_thread&);
+
public:
simple_reading_thread(boost::shared_mutex& rwm_,
boost::mutex& finish_mutex_,
Modified: branches/release/libs/thread/test/test_tss.cpp
==============================================================================
--- branches/release/libs/thread/test/test_tss.cpp (original)
+++ branches/release/libs/thread/test/test_tss.cpp 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -66,7 +66,7 @@
#if defined(BOOST_THREAD_PLATFORM_WIN32)
typedef HANDLE native_thread_t;
- DWORD WINAPI test_tss_thread_native(LPVOID lpParameter)
+ DWORD WINAPI test_tss_thread_native(LPVOID /*lpParameter*/)
{
test_tss_thread();
return 0;
Modified: branches/release/libs/thread/test/util.inl
==============================================================================
--- branches/release/libs/thread/test/util.inl (original)
+++ branches/release/libs/thread/test/util.inl 2008-03-21 11:04:10 EDT (Fri, 21 Mar 2008)
@@ -1,6 +1,6 @@
// Copyright (C) 2001-2003
// William E. Kempf
-// Copyright (C) 2007 Anthony Williams
+// Copyright (C) 2007-8 Anthony Williams
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -123,6 +123,7 @@
private:
F func;
execution_monitor& monitor;
+ void operator=(indirect_adapter&);
};
template <typename F>
@@ -165,6 +166,8 @@
void operator()() const { (param.*func)(); }
private:
+ void operator=(thread_member_binder&);
+
R (T::*func)();
T& param;
};
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