From b580df01037de5ea1a354199c9347a4174bd2d93 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Mon, 24 Mar 2008 04:57:42 +0000 Subject: [PATCH] Merged revisions 43679-43680,43685-43687,43690-43696,43701-43702,43704-43706,43709,43714-43715,43717-43719,43721-43723,43726,43730-43733,43735,43738-43739,43741-43742,43747-43748,43750,43752,43758,43766,43781-43782,43795,43799,43803-43804,43806-43809 via svnmerge from https://svn.boost.org/svn/boost/trunk ........ r43679 | dgregor | 2008-03-17 10:31:21 -0700 (Mon, 17 Mar 2008) | 1 line Fix typo ........ r43680 | dgregor | 2008-03-17 10:34:46 -0700 (Mon, 17 Mar 2008) | 1 line Fix some documentation issues. Fixes #1655, fixes #1660 ........ r43685 | eric_niebler | 2008-03-17 14:46:08 -0700 (Mon, 17 Mar 2008) | 1 line small interface simplification, doc comment improvements ........ r43686 | jano_gaspar | 2008-03-17 15:27:15 -0700 (Mon, 17 Mar 2008) | 1 line circular_buffer: bugfix #1692 ........ r43687 | hljin | 2008-03-17 15:28:58 -0700 (Mon, 17 Mar 2008) | 1 line Added two scripts ........ r43690 | ramey | 2008-03-17 21:58:51 -0700 (Mon, 17 Mar 2008) | 3 lines Support serialization in DLLS Make thread-safe fix portable binary archives ........ r43691 | ramey | 2008-03-17 22:01:57 -0700 (Mon, 17 Mar 2008) | 3 lines Support serialization in DLLS Make thread-safe fix portable binary archives ........ r43692 | ramey | 2008-03-17 22:47:10 -0700 (Mon, 17 Mar 2008) | 3 lines Support serialization in DLLS Make thread-safe fix portable binary archives ........ r43693 | ramey | 2008-03-17 22:52:10 -0700 (Mon, 17 Mar 2008) | 3 lines Support serialization in DLLS Make thread-safe fix portable binary archives ........ r43694 | ramey | 2008-03-17 22:53:07 -0700 (Mon, 17 Mar 2008) | 3 lines Support serialization in DLLS Make thread-safe fix portable binary archives ........ r43695 | eric_niebler | 2008-03-17 23:18:33 -0700 (Mon, 17 Mar 2008) | 1 line work around gcc-4.0.1 bug with const-qualified function references ........ r43696 | eric_niebler | 2008-03-17 23:44:45 -0700 (Mon, 17 Mar 2008) | 1 line better, restrict fix to gcc-4.0 ........ r43701 | ramey | 2008-03-18 08:51:13 -0700 (Tue, 18 Mar 2008) | 3 lines Support serialization in DLLS Make thread-safe fix portable binary archives ........ r43702 | ramey | 2008-03-18 08:51:42 -0700 (Tue, 18 Mar 2008) | 3 lines Support serialization in DLLS Make thread-safe fix portable binary archives ........ r43704 | ramey | 2008-03-18 09:31:36 -0700 (Tue, 18 Mar 2008) | 3 lines Support serialization in DLLS Make thread-safe fix portable binary archives ........ r43705 | ramey | 2008-03-18 09:32:22 -0700 (Tue, 18 Mar 2008) | 3 lines Support serialization in DLLS Make thread-safe fix portable binary archives ........ r43706 | ramey | 2008-03-18 09:32:48 -0700 (Tue, 18 Mar 2008) | 3 lines Support serialization in DLLS Make thread-safe fix portable binary archives ........ r43709 | bemandawes | 2008-03-18 12:35:18 -0700 (Tue, 18 Mar 2008) | 1 line Fix inspect boo boos; mostly broken links ........ r43714 | grafik | 2008-03-18 18:01:19 -0700 (Tue, 18 Mar 2008) | 1 line Disable serialization tests until Robert fixes the testing breakage. ........ r43715 | bemandawes | 2008-03-18 18:42:03 -0700 (Tue, 18 Mar 2008) | 1 line Fix broken links ........ r43717 | ramey | 2008-03-18 22:17:02 -0700 (Tue, 18 Mar 2008) | 3 lines Support serialization in DLLS Make thread-safe fix portable binary archives ........ r43718 | eric_niebler | 2008-03-18 22:18:50 -0700 (Tue, 18 Mar 2008) | 1 line correct minor doc inaccuracies ........ r43719 | jano_gaspar | 2008-03-19 02:24:24 -0700 (Wed, 19 Mar 2008) | 1 line circular_buffer: improved documentation ........ r43721 | vladimir_prus | 2008-03-19 03:51:45 -0700 (Wed, 19 Mar 2008) | 5 lines Fix #1698 (http://svn.boost.org/trac/boost/ticket/1698). * build/virtual-target.jam (register): Ignore differences in incidental dependency features. ........ r43722 | vladimir_prus | 2008-03-19 04:09:29 -0700 (Wed, 19 Mar 2008) | 3 lines Remove usage-requirements as they are not necessary, and can cause bogus dependencies for serialization's client. ........ r43723 | bemandawes | 2008-03-19 05:33:41 -0700 (Wed, 19 Mar 2008) | 1 line Fix ordering of libraries within categories. [Vicente Juan Botet] ........ r43726 | grafik | 2008-03-19 09:27:43 -0700 (Wed, 19 Mar 2008) | 1 line Re-enable serialization tests, now that they should be fixed. ........ r43730 | anthonyw | 2008-03-19 10:25:13 -0700 (Wed, 19 Mar 2008) | 1 line Removed some warnings: those from issue #1640 and others ........ r43731 | danieljames | 2008-03-19 11:22:58 -0700 (Wed, 19 Mar 2008) | 1 line Thread is now using quickbook so we have to add a dependency to get it to build, and add it to the path, as it needs to be picked up from the build location. ........ r43732 | danieljames | 2008-03-19 11:27:34 -0700 (Wed, 19 Mar 2008) | 1 line Remove 'using quickbook' from my documentation jamfiles. It is no longer necessary, and might be harmful. ........ r43733 | pdimov | 2008-03-19 12:39:50 -0700 (Wed, 19 Mar 2008) | 1 line Regression test for enable_shared_from_this. ........ r43735 | lbourdev | 2008-03-19 21:27:41 -0700 (Wed, 19 Mar 2008) | 3 lines GIL: Changed a private type name to differ from #define used on some Linux systems. ........ r43738 | fmhess | 2008-03-20 12:32:43 -0700 (Thu, 20 Mar 2008) | 4 lines Added support for calling enable_shared_from_this::shared_from_this in constructors. Closes #1696. ........ r43739 | pdimov | 2008-03-20 15:10:52 -0700 (Thu, 20 Mar 2008) | 1 line Initialize _owned in the copy constructor as well. ........ r43741 | lbourdev | 2008-03-21 02:40:59 -0700 (Fri, 21 Mar 2008) | 3 lines GIL: Fixed a bug in planar device_n view construction. ........ r43742 | lbourdev | 2008-03-21 02:43:19 -0700 (Fri, 21 Mar 2008) | 3 lines GIL: Replaced tabs with spaces. ........ r43747 | ramey | 2008-03-21 09:37:24 -0700 (Fri, 21 Mar 2008) | 1 line Added consideration for compac Tru64 ........ r43748 | ramey | 2008-03-21 09:40:06 -0700 (Fri, 21 Mar 2008) | 1 line added include for friend operators ........ r43750 | danieljames | 2008-03-21 09:52:40 -0700 (Fri, 21 Mar 2008) | 1 line Check links in single quotes as well as double quotes. ........ r43752 | danieljames | 2008-03-21 09:56:35 -0700 (Fri, 21 Mar 2008) | 1 line Decode percent coded characters and '&' when inspecting urls. ........ r43758 | ramey | 2008-03-21 10:19:07 -0700 (Fri, 21 Mar 2008) | 1 line Adjustment to inhibit compile error with intel compilers ........ r43766 | fmhess | 2008-03-21 12:19:25 -0700 (Fri, 21 Mar 2008) | 4 lines Worked around compilation error in boost::get_deleter when using old versions of g++. ........ r43781 | noel_belcourt | 2008-03-21 14:04:36 -0700 (Fri, 21 Mar 2008) | 3 lines pgi-7.1 has testable version macros, yeah! ........ r43782 | fmhess | 2008-03-21 14:12:21 -0700 (Fri, 21 Mar 2008) | 3 lines Fixed bogus test failure caused by new enable_shared_from_this features. ........ r43795 | ramey | 2008-03-22 11:59:07 -0700 (Sat, 22 Mar 2008) | 4 lines streamlined Jamfile.v2 eliminated build of binary_w* removed usage-requirement dropped serialization.jam as its no longer used ........ r43799 | grafik | 2008-03-22 15:53:35 -0700 (Sat, 22 Mar 2008) | 1 line Remove svn exec property from files that should not be executable to fix permission problems in archives. ........ r43803 | danieljames | 2008-03-23 06:03:24 -0700 (Sun, 23 Mar 2008) | 1 line Fix another license link I seem to have missed. ........ r43804 | fmhess | 2008-03-23 07:51:40 -0700 (Sun, 23 Mar 2008) | 3 lines Added a little more test code for new enable_shared_from_this behavior. ........ r43806 | ramey | 2008-03-23 11:36:00 -0700 (Sun, 23 Mar 2008) | 1 line adjusted header order for export.hpp to see if this will make gcc 4.x tests pass. ........ r43807 | ramey | 2008-03-23 12:09:51 -0700 (Sun, 23 Mar 2008) | 1 line made test compile only ........ r43808 | ramey | 2008-03-23 12:10:31 -0700 (Sun, 23 Mar 2008) | 1 line made test_static_warning compile only ........ r43809 | ramey | 2008-03-23 12:18:22 -0700 (Sun, 23 Mar 2008) | 1 line removed superflous static cast ........ [SVN r43812] --- include/boost/thread/detail/move.hpp | 2 + include/boost/thread/pthread/shared_mutex.hpp | 49 ++++++++ include/boost/thread/pthread/thread.hpp | 17 ++- include/boost/thread/pthread/thread_data.hpp | 1 + .../boost/thread/win32/basic_timed_mutex.hpp | 22 ++++ .../boost/thread/win32/condition_variable.hpp | 13 +- include/boost/thread/win32/once.hpp | 2 + include/boost/thread/win32/shared_mutex.hpp | 114 +++++++++++++++++- include/boost/thread/win32/thread.hpp | 19 ++- src/pthread/thread.cpp | 2 +- src/win32/tss_pe.cpp | 9 +- test/condition_test_common.hpp | 2 + test/shared_mutex_locking_thread.hpp | 8 ++ test/test_condition.cpp | 3 + test/test_shared_mutex_part_2.cpp | 4 + test/test_tss.cpp | 2 +- test/util.inl | 5 +- 17 files changed, 261 insertions(+), 13 deletions(-) diff --git a/include/boost/thread/detail/move.hpp b/include/boost/thread/detail/move.hpp index 011ae4ea..99beb5bb 100644 --- a/include/boost/thread/detail/move.hpp +++ b/include/boost/thread/detail/move.hpp @@ -22,6 +22,8 @@ namespace boost { return &t; } + private: + void operator=(thread_move_t&); }; } diff --git a/include/boost/thread/pthread/shared_mutex.hpp b/include/boost/thread/pthread/shared_mutex.hpp index 4cc095a2..4465f559 100644 --- a/include/boost/thread/pthread/shared_mutex.hpp +++ b/include/boost/thread/pthread/shared_mutex.hpp @@ -57,7 +57,14 @@ namespace boost 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 @@ namespace boost 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 @@ namespace boost 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 @@ namespace boost 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 @@ namespace boost { 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 @@ namespace boost { 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 @@ namespace boost 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) { diff --git a/include/boost/thread/pthread/thread.hpp b/include/boost/thread/pthread/thread.hpp index f539d568..6a2ac3d9 100644 --- a/include/boost/thread/pthread/thread.hpp +++ b/include/boost/thread/pthread/thread.hpp @@ -22,6 +22,12 @@ #include #include "thread_data.hpp" #include +#include + +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4251) +#endif namespace boost { @@ -319,7 +325,7 @@ namespace boost } } - class BOOST_THREAD_DECL thread_group : private noncopyable + class BOOST_THREAD_DECL thread_group { public: thread_group(); @@ -330,13 +336,20 @@ namespace boost 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 m_threads; mutex m_mutex; }; } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp index 234ba882..52ca40e5 100644 --- a/include/boost/thread/pthread/thread_data.hpp +++ b/include/boost/thread/pthread/thread_data.hpp @@ -72,6 +72,7 @@ namespace boost } } + void operator=(interruption_checker&); public: explicit interruption_checker(pthread_cond_t* cond): thread_info(detail::get_current_thread_data()) diff --git a/include/boost/thread/win32/basic_timed_mutex.hpp b/include/boost/thread/win32/basic_timed_mutex.hpp index 8ee199df..207c0920 100644 --- a/include/boost/thread/win32/basic_timed_mutex.hpp +++ b/include/boost/thread/win32/basic_timed_mutex.hpp @@ -33,7 +33,14 @@ namespace boost 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 @@ namespace boost 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 @@ namespace boost 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); diff --git a/include/boost/thread/win32/condition_variable.hpp b/include/boost/thread/win32/condition_variable.hpp index bfd1f1ff..6bd4efd6 100644 --- a/include/boost/thread/win32/condition_variable.hpp +++ b/include/boost/thread/win32/condition_variable.hpp @@ -55,10 +55,17 @@ namespace boost } 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 @@ namespace boost } } + private: + void operator=(relocker&); }; diff --git a/include/boost/thread/win32/once.hpp b/include/boost/thread/win32/once.hpp index b11be97a..719eaea5 100644 --- a/include/boost/thread/win32/once.hpp +++ b/include/boost/thread/win32/once.hpp @@ -46,6 +46,8 @@ namespace boost { BOOST_VERIFY(win32::ReleaseMutex(mutex_handle)!=0); } + private: + void operator=(win32_mutex_scoped_lock&); }; #ifdef BOOST_NO_ANSI_APIS diff --git a/include/boost/thread/win32/shared_mutex.hpp b/include/boost/thread/win32/shared_mutex.hpp index 3b322b1f..1c9fd1be 100644 --- a/include/boost/thread/win32/shared_mutex.hpp +++ b/include/boost/thread/win32/shared_mutex.hpp @@ -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 @@ namespace boost } 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 @@ namespace boost 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 @@ namespace boost } 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 @@ namespace boost } 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 @@ namespace boost } 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 @@ namespace boost 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 @@ namespace boost } 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 @@ namespace boost } 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 @@ namespace boost } 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 @@ namespace boost } 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 @@ namespace boost } 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 @@ namespace boost } 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 @@ namespace boost } 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 @@ namespace boost } 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 @@ namespace boost } 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); } diff --git a/include/boost/thread/win32/thread.hpp b/include/boost/thread/win32/thread.hpp index 61c2908a..90c73224 100644 --- a/include/boost/thread/win32/thread.hpp +++ b/include/boost/thread/win32/thread.hpp @@ -21,6 +21,13 @@ #include #include #include +#include +#include + +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4251) +#endif namespace boost { @@ -476,9 +483,9 @@ namespace boost thread* create_thread(F threadfunc) { boost::lock_guard guard(m); - thread* const new_thread=new thread(threadfunc); - threads.push_back(new_thread); - return new_thread; + std::auto_ptr new_thread(new thread(threadfunc)); + threads.push_back(new_thread.get()); + return new_thread.release(); } void add_thread(thread* thrd) @@ -524,7 +531,7 @@ namespace boost } } - int size() const + size_t size() const { boost::lock_guard guard(m); return threads.size(); @@ -536,4 +543,8 @@ namespace boost }; } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif diff --git a/src/pthread/thread.cpp b/src/pthread/thread.cpp index 0add81c6..754e0af5 100644 --- a/src/pthread/thread.cpp +++ b/src/pthread/thread.cpp @@ -683,7 +683,7 @@ namespace boost } - int thread_group::size() const + size_t thread_group::size() const { return m_threads.size(); } diff --git a/src/win32/tss_pe.cpp b/src/win32/tss_pe.cpp index dec71c3b..bd2e61d8 100644 --- a/src/win32/tss_pe.cpp +++ b/src/win32/tss_pe.cpp @@ -164,6 +164,10 @@ extern "C" const IMAGE_TLS_DIRECTORY32 _tls_used __attribute__ ((section(".rdata #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 @@ extern "C" const IMAGE_TLS_DIRECTORY32 _tls_used __attribute__ ((section(".rdata return INIRETSUCCESS; } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif PVAPI on_process_init(void) { @@ -228,7 +235,7 @@ extern "C" const IMAGE_TLS_DIRECTORY32 _tls_used __attribute__ ((section(".rdata 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) { diff --git a/test/condition_test_common.hpp b/test/condition_test_common.hpp index df7d5edc..38f77909 100644 --- a/test/condition_test_common.hpp +++ b/test/condition_test_common.hpp @@ -34,6 +34,8 @@ struct wait_for_flag { return flag; } + private: + void operator=(check_flag&); }; diff --git a/test/shared_mutex_locking_thread.hpp b/test/shared_mutex_locking_thread.hpp index 1fccbddf..0d071bd8 100644 --- a/test/shared_mutex_locking_thread.hpp +++ b/test/shared_mutex_locking_thread.hpp @@ -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 #include #include @@ -56,6 +62,8 @@ public: --simultaneous_running_count; } } +private: + void operator=(locking_thread&); }; diff --git a/test/test_condition.cpp b/test/test_condition.cpp index 96b1e86e..ea008bfe 100644 --- a/test/test_condition.cpp +++ b/test/test_condition.cpp @@ -43,6 +43,9 @@ struct cond_predicate int& _var; int _val; +private: + void operator=(cond_predicate&); + }; void condition_test_waits(condition_test_data* data) diff --git a/test/test_shared_mutex_part_2.cpp b/test/test_shared_mutex_part_2.cpp index 5666a956..ae7348df 100644 --- a/test/test_shared_mutex_part_2.cpp +++ b/test/test_shared_mutex_part_2.cpp @@ -116,6 +116,8 @@ namespace 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 @@ namespace boost::mutex& unblocked_mutex; unsigned& unblocked_count; + void operator=(simple_reading_thread&); + public: simple_reading_thread(boost::shared_mutex& rwm_, boost::mutex& finish_mutex_, diff --git a/test/test_tss.cpp b/test/test_tss.cpp index 51dcb7ff..bbd78d42 100644 --- a/test/test_tss.cpp +++ b/test/test_tss.cpp @@ -66,7 +66,7 @@ void test_tss_thread() #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; diff --git a/test/util.inl b/test/util.inl index 417b255d..5c761d50 100644 --- a/test/util.inl +++ b/test/util.inl @@ -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 @@ public: private: F func; execution_monitor& monitor; + void operator=(indirect_adapter&); }; template @@ -165,6 +166,8 @@ public: void operator()() const { (param.*func)(); } private: + void operator=(thread_member_binder&); + R (T::*func)(); T& param; };