passenger 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- data/DEVELOPERS.TXT +9 -6
- data/NEWS +50 -0
- data/Rakefile +2 -1
- data/bin/passenger-install-apache2-module +4 -4
- data/bin/passenger-install-nginx-module +1 -1
- data/bin/passenger-make-enterprisey +1 -1
- data/build/agents.rb +26 -19
- data/build/apache2.rb +49 -46
- data/build/basics.rb +37 -13
- data/build/common_library.rb +134 -64
- data/build/config.rb +18 -11
- data/build/cplusplus_support.rb +4 -0
- data/build/cxx_tests.rb +26 -12
- data/build/documentation.rb +18 -11
- data/build/integration_tests.rb +18 -11
- data/build/misc.rb +18 -11
- data/build/nginx.rb +27 -19
- data/build/oxt_tests.rb +18 -11
- data/build/packaging.rb +45 -37
- data/build/rpm.rb +98 -0
- data/build/ruby_extension.rb +19 -13
- data/build/ruby_tests.rb +19 -12
- data/build/test_basics.rb +23 -11
- data/debian/README.Debian +15 -0
- data/debian/changelog +185 -0
- data/debian/control +47 -19
- data/debian/copyright +20 -0
- data/debian/libapache2-mod-passenger.install +1 -0
- data/debian/libapache2-mod-passenger.postinst +36 -0
- data/debian/libapache2-mod-passenger.prerm +15 -0
- data/debian/passenger-common.install +4 -0
- data/debian/passenger.conf +4 -0
- data/debian/passenger.load +1 -0
- data/debian/rules +37 -0
- data/debian/watch +3 -0
- data/{misc → dev}/copy_boost_headers.rb +3 -0
- data/{misc → dev}/find_owner_pipe_leaks.rb +0 -0
- data/{misc → dev}/render_error_pages.rb +0 -0
- data/doc/Users guide Apache.html +39 -1
- data/doc/Users guide Apache.txt +40 -0
- data/doc/Users guide Nginx.html +1 -1
- data/doc/Users guide Standalone.html +1 -1
- data/doc/cxxapi/Constants_8h_source.html +1 -1
- data/doc/cxxapi/DirectoryMapper_8h_source.html +6 -22
- data/doc/cxxapi/EventedClient_8h_source.html +572 -468
- data/doc/cxxapi/Exceptions_8h_source.html +142 -129
- data/doc/cxxapi/FileDescriptor_8h_source.html +263 -199
- data/doc/cxxapi/MessageChannel_8h_source.html +686 -770
- data/doc/cxxapi/MessageServer_8h_source.html +1 -1
- data/doc/cxxapi/PoolOptions_8h_source.html +79 -78
- data/doc/cxxapi/ResourceLocator_8h_source.html +105 -55
- data/doc/cxxapi/SafeLibev_8h_source.html +180 -0
- data/doc/cxxapi/ServerInstanceDir_8h_source.html +114 -110
- data/doc/cxxapi/Session_8h_source.html +1 -1
- data/doc/cxxapi/SpawnManager_8h_source.html +208 -208
- data/doc/cxxapi/StaticString_8h_source.html +258 -183
- data/doc/cxxapi/Utils_8h_source.html +71 -54
- data/doc/cxxapi/annotated.html +3 -0
- data/doc/cxxapi/classAgentWatcher.html +2 -2
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +0 -1
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +0 -27
- data/doc/cxxapi/classPassenger_1_1EventedClient-members.html +5 -0
- data/doc/cxxapi/classPassenger_1_1EventedClient.html +102 -7
- data/doc/cxxapi/classPassenger_1_1FileDescriptor-members.html +2 -1
- data/doc/cxxapi/classPassenger_1_1FileDescriptor.html +34 -8
- data/doc/cxxapi/classPassenger_1_1FileDescriptorPair-members.html +36 -0
- data/doc/cxxapi/classPassenger_1_1FileDescriptorPair.html +52 -0
- data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +0 -3
- data/doc/cxxapi/classPassenger_1_1MessageChannel.html +0 -120
- data/doc/cxxapi/classPassenger_1_1SafeLibev-members.html +36 -0
- data/doc/cxxapi/classPassenger_1_1SafeLibev.html +51 -0
- data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +1 -0
- data/doc/cxxapi/classPassenger_1_1SpawnException.html +22 -0
- data/doc/cxxapi/classes.html +14 -14
- data/doc/cxxapi/files.html +2 -0
- data/doc/cxxapi/functions_0x63.html +6 -3
- data/doc/cxxapi/functions_0x64.html +9 -2
- data/doc/cxxapi/functions_0x67.html +6 -9
- data/doc/cxxapi/functions_0x69.html +3 -0
- data/doc/cxxapi/functions_0x77.html +8 -8
- data/doc/cxxapi/functions_eval.html +6 -0
- data/doc/cxxapi/functions_func.html +18 -17
- data/doc/cxxapi/functions_vars.html +8 -0
- data/doc/cxxapi/graph_legend.png +0 -0
- data/doc/cxxapi/group__Core.png +0 -0
- data/doc/cxxapi/group__Hooks.png +0 -0
- data/doc/cxxapi/hierarchy.html +3 -0
- data/doc/cxxapi/inherit__graph__14.map +1 -1
- data/doc/cxxapi/inherit__graph__14.md5 +1 -1
- data/doc/cxxapi/inherit__graph__14.png +0 -0
- data/doc/cxxapi/inherit__graph__15.map +1 -3
- data/doc/cxxapi/inherit__graph__15.md5 +1 -1
- data/doc/cxxapi/inherit__graph__15.png +0 -0
- data/doc/cxxapi/inherit__graph__16.map +3 -1
- data/doc/cxxapi/inherit__graph__16.md5 +1 -1
- data/doc/cxxapi/inherit__graph__16.png +0 -0
- data/doc/cxxapi/inherit__graph__17.map +1 -1
- data/doc/cxxapi/inherit__graph__17.md5 +1 -1
- data/doc/cxxapi/inherit__graph__17.png +0 -0
- data/doc/cxxapi/inherit__graph__18.map +1 -2
- data/doc/cxxapi/inherit__graph__18.md5 +1 -1
- data/doc/cxxapi/inherit__graph__18.png +0 -0
- data/doc/cxxapi/inherit__graph__19.map +2 -1
- data/doc/cxxapi/inherit__graph__19.md5 +1 -1
- data/doc/cxxapi/inherit__graph__19.png +0 -0
- data/doc/cxxapi/inherit__graph__20.map +1 -1
- data/doc/cxxapi/inherit__graph__20.md5 +1 -1
- data/doc/cxxapi/inherit__graph__20.png +0 -0
- data/doc/cxxapi/inherit__graph__21.map +1 -1
- data/doc/cxxapi/inherit__graph__21.md5 +1 -1
- data/doc/cxxapi/inherit__graph__21.png +0 -0
- data/doc/cxxapi/inherit__graph__22.map +1 -1
- data/doc/cxxapi/inherit__graph__22.md5 +1 -1
- data/doc/cxxapi/inherit__graph__22.png +0 -0
- data/doc/cxxapi/inherit__graph__23.map +1 -1
- data/doc/cxxapi/inherit__graph__23.md5 +1 -1
- data/doc/cxxapi/inherit__graph__23.png +0 -0
- data/doc/cxxapi/inherit__graph__24.map +1 -1
- data/doc/cxxapi/inherit__graph__24.md5 +1 -1
- data/doc/cxxapi/inherit__graph__24.png +0 -0
- data/doc/cxxapi/inherit__graph__25.map +1 -1
- data/doc/cxxapi/inherit__graph__25.md5 +1 -1
- data/doc/cxxapi/inherit__graph__25.png +0 -0
- data/doc/cxxapi/inherit__graph__26.map +1 -1
- data/doc/cxxapi/inherit__graph__26.md5 +1 -1
- data/doc/cxxapi/inherit__graph__26.png +0 -0
- data/doc/cxxapi/inherit__graph__27.map +1 -1
- data/doc/cxxapi/inherit__graph__27.md5 +1 -1
- data/doc/cxxapi/inherit__graph__27.png +0 -0
- data/doc/cxxapi/inherit__graph__28.map +1 -2
- data/doc/cxxapi/inherit__graph__28.md5 +1 -1
- data/doc/cxxapi/inherit__graph__28.png +0 -0
- data/doc/cxxapi/inherit__graph__29.map +1 -1
- data/doc/cxxapi/inherit__graph__29.md5 +1 -1
- data/doc/cxxapi/inherit__graph__29.png +0 -0
- data/doc/cxxapi/inherit__graph__30.map +1 -1
- data/doc/cxxapi/inherit__graph__30.md5 +1 -1
- data/doc/cxxapi/inherit__graph__30.png +0 -0
- data/doc/cxxapi/inherit__graph__31.map +2 -1
- data/doc/cxxapi/inherit__graph__31.md5 +1 -1
- data/doc/cxxapi/inherit__graph__31.png +0 -0
- data/doc/cxxapi/inherit__graph__32.map +1 -3
- data/doc/cxxapi/inherit__graph__32.md5 +1 -1
- data/doc/cxxapi/inherit__graph__32.png +0 -0
- data/doc/cxxapi/inherit__graph__33.map +1 -1
- data/doc/cxxapi/inherit__graph__33.md5 +1 -1
- data/doc/cxxapi/inherit__graph__33.png +0 -0
- data/doc/cxxapi/inherit__graph__34.map +1 -1
- data/doc/cxxapi/inherit__graph__34.md5 +1 -1
- data/doc/cxxapi/inherit__graph__34.png +0 -0
- data/doc/cxxapi/inherit__graph__35.map +3 -1
- data/doc/cxxapi/inherit__graph__35.md5 +1 -1
- data/doc/cxxapi/inherit__graph__35.png +0 -0
- data/doc/cxxapi/inherit__graph__36.map +1 -1
- data/doc/cxxapi/inherit__graph__36.md5 +1 -1
- data/doc/cxxapi/inherit__graph__36.png +0 -0
- data/doc/cxxapi/inherit__graph__37.map +1 -1
- data/doc/cxxapi/inherit__graph__37.md5 +1 -1
- data/doc/cxxapi/inherit__graph__37.png +0 -0
- data/doc/cxxapi/inherit__graph__38.map +3 -1
- data/doc/cxxapi/inherit__graph__38.md5 +1 -1
- data/doc/cxxapi/inherit__graph__38.png +0 -0
- data/doc/cxxapi/inherit__graph__39.map +3 -1
- data/doc/cxxapi/inherit__graph__39.md5 +1 -1
- data/doc/cxxapi/inherit__graph__39.png +0 -0
- data/doc/cxxapi/inherits.html +33 -24
- data/doc/cxxapi/namespacePassenger.html +52 -0
- data/doc/cxxapi/namespacemembers.html +6 -0
- data/doc/cxxapi/namespacemembers_func.html +6 -0
- data/doc/cxxapi/tree.html +8 -0
- data/ext/apache2/Configuration.cpp +30 -8
- data/ext/apache2/Configuration.hpp +15 -14
- data/ext/apache2/DirectoryMapper.h +0 -16
- data/ext/apache2/Hooks.cpp +30 -29
- data/ext/boost/algorithm/string/detail/case_conv.hpp +6 -6
- data/ext/boost/algorithm/string/detail/find_format.hpp +14 -4
- data/ext/boost/algorithm/string/detail/find_format_all.hpp +13 -3
- data/ext/boost/algorithm/string/detail/find_format_store.hpp +11 -0
- data/ext/boost/algorithm/string/erase.hpp +2 -2
- data/ext/boost/bind/placeholders.hpp +2 -2
- data/ext/boost/concept/detail/backward_compatibility.hpp +16 -0
- data/ext/boost/concept/detail/general.hpp +15 -6
- data/ext/boost/concept/detail/has_constraints.hpp +5 -3
- data/ext/boost/concept/usage.hpp +5 -4
- data/ext/boost/concept_check.hpp +10 -1
- data/ext/boost/config/abi/borland_prefix.hpp +1 -1
- data/ext/boost/config/auto_link.hpp +68 -21
- data/ext/boost/config/compiler/borland.hpp +11 -3
- data/ext/boost/config/compiler/clang.hpp +62 -0
- data/ext/boost/config/compiler/codegear.hpp +21 -7
- data/ext/boost/config/compiler/common_edg.hpp +4 -2
- data/ext/boost/config/compiler/digitalmars.hpp +1 -1
- data/ext/boost/config/compiler/gcc.hpp +46 -7
- data/ext/boost/config/compiler/gcc_xml.hpp +25 -0
- data/ext/boost/config/compiler/intel.hpp +23 -0
- data/ext/boost/config/compiler/kai.hpp +1 -1
- data/ext/boost/config/compiler/metrowerks.hpp +1 -1
- data/ext/boost/config/compiler/nvcc.hpp +86 -0
- data/ext/boost/config/compiler/pgi.hpp +18 -3
- data/ext/boost/config/compiler/sunpro_cc.hpp +19 -5
- data/ext/boost/config/compiler/vacpp.hpp +8 -0
- data/ext/boost/config/compiler/visualc.hpp +27 -11
- data/ext/boost/config/platform/cygwin.hpp +0 -3
- data/ext/boost/config/platform/symbian.hpp +94 -0
- data/ext/boost/config/platform/win32.hpp +8 -1
- data/ext/boost/config/select_compiler_config.hpp +10 -0
- data/ext/boost/config/select_platform_config.hpp +4 -0
- data/ext/boost/config/stdlib/dinkumware.hpp +11 -1
- data/ext/boost/config/stdlib/libcomo.hpp +1 -0
- data/ext/boost/config/stdlib/libstdcpp3.hpp +1 -0
- data/ext/boost/config/stdlib/modena.hpp +1 -0
- data/ext/boost/config/stdlib/msl.hpp +1 -0
- data/ext/boost/config/stdlib/roguewave.hpp +1 -0
- data/ext/boost/config/stdlib/sgi.hpp +1 -0
- data/ext/boost/config/stdlib/stlport.hpp +1 -0
- data/ext/boost/config/stdlib/vacpp.hpp +1 -0
- data/ext/boost/config/suffix.hpp +40 -2
- data/ext/boost/cstdint.hpp +36 -7
- data/ext/boost/date_time/gregorian/conversion.hpp +4 -2
- data/ext/boost/date_time/microsec_time_clock.hpp +7 -7
- data/ext/boost/date_time/posix_time/conversion.hpp +4 -2
- data/ext/boost/date_time/time_facet.hpp +43 -4
- data/ext/boost/detail/endian.hpp +5 -2
- data/ext/boost/detail/lcast_precision.hpp +2 -2
- data/ext/boost/detail/sp_typeinfo.hpp +1 -1
- data/ext/boost/detail/workaround.hpp +5 -0
- data/ext/boost/exception/detail/error_info_impl.hpp +3 -3
- data/ext/boost/exception/detail/exception_ptr.hpp +76 -135
- data/ext/boost/exception/detail/is_output_streamable.hpp +15 -2
- data/ext/boost/exception/detail/type_info.hpp +9 -5
- data/ext/boost/exception/diagnostic_information.hpp +5 -3
- data/ext/boost/exception/exception.hpp +60 -46
- data/ext/boost/exception/info.hpp +47 -14
- data/ext/boost/function/function_base.hpp +4 -4
- data/ext/boost/integer.hpp +4 -0
- data/ext/boost/integer_fwd.hpp +9 -3
- data/ext/boost/iterator/iterator_concepts.hpp +284 -0
- data/ext/boost/iterator/transform_iterator.hpp +0 -1
- data/ext/boost/make_shared.hpp +17 -0
- data/ext/boost/mpl/aux_/config/has_xxx.hpp +4 -3
- data/ext/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp +2 -6
- data/ext/boost/mpl/aux_/template_arity.hpp +4 -4
- data/ext/boost/mpl/eval_if.hpp +3 -3
- data/ext/boost/mpl/has_xxx.hpp +369 -3
- data/ext/boost/optional/optional.hpp +3 -1
- data/ext/boost/optional/optional_fwd.hpp +1 -1
- data/ext/boost/preprocessor/repetition/enum_trailing_params.hpp +38 -0
- data/ext/boost/range/algorithm/equal.hpp +188 -0
- data/ext/boost/range/as_literal.hpp +15 -15
- data/ext/boost/range/concepts.hpp +331 -0
- data/ext/boost/range/const_iterator.hpp +7 -4
- data/ext/boost/range/detail/extract_optional_type.hpp +52 -0
- data/ext/boost/range/detail/implementation_help.hpp +7 -7
- data/ext/boost/range/detail/misc_concept.hpp +33 -0
- data/ext/boost/range/iterator.hpp +32 -32
- data/ext/boost/range/iterator_range.hpp +8 -651
- data/ext/boost/range/iterator_range_core.hpp +542 -0
- data/ext/boost/range/iterator_range_io.hpp +93 -0
- data/ext/boost/range/mutable_iterator.hpp +7 -4
- data/ext/boost/range/size.hpp +1 -1
- data/ext/boost/range/size_type.hpp +2 -1
- data/ext/boost/shared_array.hpp +19 -0
- data/ext/boost/smart_ptr/detail/sp_convertible.hpp +2 -2
- data/ext/boost/smart_ptr/detail/yield_k.hpp +1 -1
- data/ext/boost/smart_ptr/make_shared.hpp +508 -0
- data/ext/boost/smart_ptr/shared_array.hpp +147 -0
- data/ext/boost/src/pthread/thread.cpp +16 -21
- data/ext/boost/src/pthread/timeconv.inl +7 -4
- data/ext/boost/thread/barrier.hpp +2 -1
- data/ext/boost/thread/detail/config.hpp +7 -1
- data/ext/boost/thread/detail/platform.hpp +1 -1
- data/ext/boost/thread/detail/thread.hpp +62 -18
- data/ext/boost/thread/detail/thread_group.hpp +5 -2
- data/ext/boost/thread/detail/tss_hooks.hpp +8 -25
- data/ext/boost/thread/future.hpp +45 -34
- data/ext/boost/thread/locks.hpp +184 -55
- data/ext/boost/thread/pthread/condition_variable.hpp +7 -7
- data/ext/boost/thread/pthread/condition_variable_fwd.hpp +4 -2
- data/ext/boost/thread/pthread/mutex.hpp +29 -17
- data/ext/boost/thread/pthread/once.hpp +5 -0
- data/ext/boost/thread/pthread/recursive_mutex.hpp +97 -18
- data/ext/boost/thread/pthread/shared_mutex.hpp +1 -1
- data/ext/boost/thread/pthread/thread_heap_alloc.hpp +1 -1
- data/ext/boost/thread/tss.hpp +2 -0
- data/ext/boost/throw_exception.hpp +21 -5
- data/ext/boost/token_functions.hpp +111 -91
- data/ext/boost/type_traits/add_reference.hpp +19 -1
- data/ext/boost/type_traits/function_traits.hpp +2 -2
- data/ext/boost/type_traits/is_const.hpp +24 -5
- data/ext/boost/type_traits/is_convertible.hpp +1 -1
- data/ext/boost/type_traits/is_function.hpp +3 -0
- data/ext/boost/type_traits/is_lvalue_reference.hpp +118 -0
- data/ext/boost/type_traits/is_reference.hpp +8 -81
- data/ext/boost/type_traits/is_rvalue_reference.hpp +29 -0
- data/ext/boost/type_traits/is_same.hpp +2 -2
- data/ext/boost/type_traits/is_volatile.hpp +26 -7
- data/ext/boost/type_traits/remove_const.hpp +12 -0
- data/ext/boost/type_traits/remove_cv.hpp +23 -1
- data/ext/boost/type_traits/remove_reference.hpp +21 -1
- data/ext/boost/type_traits/type_with_alignment.hpp +10 -10
- data/ext/boost/units/detail/utility.hpp +104 -0
- data/ext/boost/utility/compare_pointees.hpp +1 -1
- data/ext/common/AgentsStarter.hpp +151 -161
- data/ext/common/ApplicationPool/Pool.h +16 -4
- data/ext/common/Constants.h +1 -1
- data/ext/common/EventedClient.h +130 -26
- data/ext/common/Exceptions.h +15 -2
- data/ext/common/FileDescriptor.h +76 -12
- data/ext/common/IniFile.h +488 -0
- data/ext/common/LoggingAgent/LoggingServer.h +2 -2
- data/ext/common/LoggingAgent/RemoteSender.h +15 -6
- data/ext/common/MessageChannel.h +17 -101
- data/ext/common/PoolOptions.h +1 -0
- data/ext/common/ResourceLocator.h +78 -28
- data/ext/common/SafeLibev.h +149 -0
- data/ext/common/ServerInstanceDir.h +11 -7
- data/ext/common/Session.h +1 -1
- data/ext/common/SpawnManager.h +14 -14
- data/ext/common/StaticString.h +75 -0
- data/ext/common/Utils.cpp +304 -12
- data/ext/common/Utils.h +17 -0
- data/ext/common/Utils/BufferedIO.h +196 -0
- data/ext/common/Utils/IOUtils.cpp +159 -0
- data/ext/common/Utils/IOUtils.h +118 -1
- data/ext/common/Utils/ProcessMetricsCollector.h +184 -56
- data/ext/common/Utils/StrIntUtils.cpp +45 -11
- data/ext/common/Utils/StrIntUtils.h +8 -5
- data/ext/common/Utils/Timer.h +22 -0
- data/ext/common/Utils/utf8.h +35 -0
- data/ext/common/Utils/utf8/checked.h +324 -0
- data/ext/common/Utils/utf8/core.h +359 -0
- data/ext/common/Utils/utf8/unchecked.h +229 -0
- data/ext/common/Watchdog.cpp +52 -85
- data/ext/libev/config.h +122 -0
- data/ext/nginx/Configuration.c +7 -1
- data/ext/nginx/HelperAgent.cpp +16 -18
- data/ext/nginx/config +6 -4
- data/ext/oxt/system_calls.cpp +10 -0
- data/ext/oxt/system_calls.hpp +2 -0
- data/lib/phusion_passenger.rb +6 -11
- data/lib/phusion_passenger/dependencies.rb +2 -0
- data/lib/phusion_passenger/packaging.rb +5 -5
- data/lib/phusion_passenger/platform_info.rb +88 -0
- data/lib/phusion_passenger/platform_info/binary_compatibility.rb +3 -17
- data/lib/phusion_passenger/platform_info/compiler.rb +14 -32
- data/lib/phusion_passenger/platform_info/curl.rb +6 -1
- data/lib/phusion_passenger/platform_info/operating_system.rb +107 -0
- data/lib/phusion_passenger/public_api.rb +2 -2
- data/lib/phusion_passenger/rails3_extensions/init.rb +5 -2
- data/lib/phusion_passenger/standalone/command.rb +6 -2
- data/lib/phusion_passenger/standalone/package_runtime_command.rb +2 -2
- data/lib/phusion_passenger/standalone/runtime_installer.rb +17 -5
- data/lib/phusion_passenger/standalone/start_command.rb +12 -12
- data/lib/phusion_passenger/standalone/stop_command.rb +3 -3
- data/lib/phusion_passenger/standalone/utils.rb +6 -2
- data/lib/phusion_passenger/templates/standalone/config.erb +37 -5
- data/lib/phusion_passenger/utils.rb +4 -7
- data/resources/mime.types +73 -0
- data/{misc → resources}/union_station_gateway.crt +0 -0
- data/test/cxx/BufferedIOTest.cpp +364 -0
- data/test/cxx/EventedClientTest.cpp +150 -13
- data/test/cxx/IOUtilsTest.cpp +399 -1
- data/test/cxx/MessageChannelTest.cpp +5 -120
- data/test/cxx/ProcessMetricsCollectorTest.cpp +121 -0
- data/test/cxx/StaticStringTest.cpp +134 -0
- data/test/cxx/UtilsTest.cpp +16 -46
- data/test/stub/rails_apps/2.3/mycook/public/dispatch.cgi +2 -2
- data/test/stub/rails_apps/2.3/mycook/public/dispatch.fcgi +1 -1
- data/test/stub/rails_apps/2.3/mycook/public/dispatch.rb +1 -1
- data/test/stub/rails_apps/3.0/empty/Gemfile.lock +73 -0
- data/test/support/allocate_memory.c +14 -0
- data/test/support/test_helper.rb +3 -0
- metadata +57 -174
- data/bin/passenger-stress-test +0 -345
- data/debian/postinst +0 -24
- data/doc/rdoc/classes/ConditionVariable.html +0 -215
- data/doc/rdoc/classes/Exception.html +0 -120
- data/doc/rdoc/classes/GC.html +0 -113
- data/doc/rdoc/classes/IO.html +0 -221
- data/doc/rdoc/classes/PhusionPassenger.html +0 -397
- data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -180
- data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -647
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -654
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/InvalidPassword.html +0 -92
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
- data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -619
- data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -142
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats.html +0 -368
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats/Process.html +0 -231
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance.html +0 -588
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/CorruptedDirectoryError.html +0 -92
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/GenerationsAbsentError.html +0 -92
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Group.html +0 -147
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Process.html +0 -279
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/RoleDeniedError.html +0 -92
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/StaleDirectoryError.html +0 -92
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Stats.html +0 -123
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/UnsupportedGenerationStructureVersionError.html +0 -92
- data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger.html +0 -341
- data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/Log.html +0 -294
- data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/SharedData.html +0 -199
- data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -155
- data/doc/rdoc/classes/PhusionPassenger/AppProcess.html +0 -367
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails.html +0 -95
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner.html +0 -351
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner/Error.html +0 -98
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/CGIFixed.html +0 -200
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner.html +0 -410
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner/Error.html +0 -98
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/RequestHandler.html +0 -156
- data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions.html +0 -115
- data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions/AnalyticsLogging.html +0 -202
- data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
- data/doc/rdoc/classes/PhusionPassenger/DebugLogging.html +0 -273
- data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
- data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -162
- data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
- data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
- data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -673
- data/doc/rdoc/classes/PhusionPassenger/MessageChannel/InvalidHashError.html +0 -92
- data/doc/rdoc/classes/PhusionPassenger/MessageClient.html +0 -415
- data/doc/rdoc/classes/PhusionPassenger/NativeSupportLoader.html +0 -134
- data/doc/rdoc/classes/PhusionPassenger/Packaging.html +0 -129
- data/doc/rdoc/classes/PhusionPassenger/PlatformInfo.html +0 -1809
- data/doc/rdoc/classes/PhusionPassenger/Plugin.html +0 -237
- data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
- data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -312
- data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner/Error.html +0 -98
- data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -218
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions.html +0 -114
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging.html +0 -256
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ACExtension.html +0 -139
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ASBenchmarkableExtension.html +0 -118
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ExceptionLogger.html +0 -135
- data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -378
- data/doc/rdoc/classes/PhusionPassenger/Standalone.html +0 -111
- data/doc/rdoc/classes/PhusionPassenger/Standalone/AppFinder.html +0 -252
- data/doc/rdoc/classes/PhusionPassenger/Standalone/Command.html +0 -161
- data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile.html +0 -368
- data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile/DisallowedContextError.html +0 -132
- data/doc/rdoc/classes/PhusionPassenger/Standalone/HelpCommand.html +0 -151
- data/doc/rdoc/classes/PhusionPassenger/Standalone/Main.html +0 -189
- data/doc/rdoc/classes/PhusionPassenger/Standalone/PackageRuntimeCommand.html +0 -177
- data/doc/rdoc/classes/PhusionPassenger/Standalone/RuntimeInstaller.html +0 -341
- data/doc/rdoc/classes/PhusionPassenger/Standalone/StartCommand.html +0 -203
- data/doc/rdoc/classes/PhusionPassenger/Standalone/StatusCommand.html +0 -156
- data/doc/rdoc/classes/PhusionPassenger/Standalone/StopCommand.html +0 -168
- data/doc/rdoc/classes/PhusionPassenger/Standalone/Utils.html +0 -86
- data/doc/rdoc/classes/PhusionPassenger/Standalone/VersionCommand.html +0 -135
- data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
- data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -1550
- data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher.html +0 -204
- data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/DirInfo.html +0 -171
- data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/FileInfo.html +0 -140
- data/doc/rdoc/classes/PhusionPassenger/Utils/HostsFileParser.html +0 -260
- data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +0 -169
- data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput.html +0 -265
- data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput/Tempfile.html +0 -120
- data/doc/rdoc/classes/PhusionPassenger/Utils/UnseekableSocket.html +0 -561
- data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
- data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
- data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -182
- data/doc/rdoc/classes/Process.html +0 -115
- data/doc/rdoc/classes/Signal.html +0 -139
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -276
- data/doc/rdoc/files/README.html +0 -157
- data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -130
- data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -135
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -128
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/memory_stats_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/server_instance_rb.html +0 -132
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/analytics_logger_rb.html +0 -129
- data/doc/rdoc/files/lib/phusion_passenger/app_process_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails/application_spawner_rb.html +0 -141
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails/cgi_fixed_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails/framework_spawner_rb.html +0 -146
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails/request_handler_rb.html +0 -125
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails_extensions/init_rb.html +0 -132
- data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/debug_logging_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -147
- data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -120
- data/doc/rdoc/files/lib/phusion_passenger/message_client_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/native_support_rb.html +0 -132
- data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/apache_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/binary_compatibility_rb.html +0 -129
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/compiler_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/curl_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/documentation_tools_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/linux_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/operating_system_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/ruby_rb.html +0 -128
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/zlib_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/plugin_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/public_api_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -137
- data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -125
- data/doc/rdoc/files/lib/phusion_passenger/rails3_extensions/init_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -160
- data/doc/rdoc/files/lib/phusion_passenger/standalone/app_finder_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/standalone/command_rb.html +0 -135
- data/doc/rdoc/files/lib/phusion_passenger/standalone/config_file_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/standalone/help_command_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/standalone/main_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/standalone/package_runtime_command_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/standalone/runtime_installer_rb.html +0 -133
- data/doc/rdoc/files/lib/phusion_passenger/standalone/start_command_rb.html +0 -136
- data/doc/rdoc/files/lib/phusion_passenger/standalone/status_command_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/standalone/stop_command_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/standalone/utils_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/standalone/version_command_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/utils/file_system_watcher_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/utils/hosts_file_parser_rb.html +0 -120
- data/doc/rdoc/files/lib/phusion_passenger/utils/rewindable_input_rb.html +0 -100
- data/doc/rdoc/files/lib/phusion_passenger/utils/tmpdir_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/utils/unseekable_socket_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -179
- data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -132
- data/doc/rdoc/fr_class_index.html +0 -138
- data/doc/rdoc/fr_file_index.html +0 -108
- data/doc/rdoc/fr_method_index.html +0 -430
- data/doc/rdoc/index.html +0 -26
- data/doc/rdoc/rdoc-style.css +0 -187
- data/ext/apache2/LICENSE-CNRI.TXT +0 -79
- data/ext/common/Utils/BlockingScalar.h +0 -50
- data/ext/common/Utils/FileHandleGuard.h +0 -81
@@ -18,10 +18,13 @@
|
|
18
18
|
|
19
19
|
namespace boost
|
20
20
|
{
|
21
|
-
class thread_group
|
22
|
-
private noncopyable
|
21
|
+
class thread_group
|
23
22
|
{
|
23
|
+
private:
|
24
|
+
thread_group(thread_group const&);
|
25
|
+
thread_group& operator=(thread_group const&);
|
24
26
|
public:
|
27
|
+
thread_group() {}
|
25
28
|
~thread_group()
|
26
29
|
{
|
27
30
|
for(std::list<thread*>::iterator it=threads.begin(),end=threads.end();
|
@@ -12,27 +12,9 @@
|
|
12
12
|
|
13
13
|
#if defined(BOOST_HAS_WINTHREADS)
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
thread_exit_handler exit_handler
|
19
|
-
);
|
20
|
-
//Add a function to the list of functions that will
|
21
|
-
//be called when a thread is about to exit.
|
22
|
-
//Currently only implemented for Win32, but should
|
23
|
-
//later be implemented for all platforms.
|
24
|
-
//Used by Win32 implementation of Boost.Threads
|
25
|
-
//tss to perform cleanup.
|
26
|
-
//Like the C runtime library atexit() function,
|
27
|
-
//which it mimics, at_thread_exit() returns
|
28
|
-
//zero if successful and a nonzero
|
29
|
-
//value if an error occurs.
|
30
|
-
|
31
|
-
#endif //defined(BOOST_HAS_WINTHREADS)
|
32
|
-
|
33
|
-
#if defined(BOOST_HAS_WINTHREADS)
|
34
|
-
|
35
|
-
extern "C" BOOST_THREAD_DECL void on_process_enter(void);
|
15
|
+
namespace boost
|
16
|
+
{
|
17
|
+
BOOST_THREAD_DECL void __cdecl on_process_enter(void);
|
36
18
|
//Function to be called when the exe or dll
|
37
19
|
//that uses Boost.Threads first starts
|
38
20
|
//or is first loaded.
|
@@ -42,7 +24,7 @@
|
|
42
24
|
//a method for doing so has been discovered.
|
43
25
|
//May be omitted; may be called multiple times.
|
44
26
|
|
45
|
-
|
27
|
+
BOOST_THREAD_DECL void __cdecl on_process_exit(void);
|
46
28
|
//Function to be called when the exe or dll
|
47
29
|
//that uses Boost.Threads first starts
|
48
30
|
//or is first loaded.
|
@@ -52,7 +34,7 @@
|
|
52
34
|
//a method for doing so has been discovered.
|
53
35
|
//Must not be omitted; may be called multiple times.
|
54
36
|
|
55
|
-
|
37
|
+
BOOST_THREAD_DECL void __cdecl on_thread_enter(void);
|
56
38
|
//Function to be called just after a thread starts
|
57
39
|
//in an exe or dll that uses Boost.Threads.
|
58
40
|
//Must be called in the context of the thread
|
@@ -61,7 +43,7 @@
|
|
61
43
|
//a method for doing so has been discovered.
|
62
44
|
//May be omitted; may be called multiple times.
|
63
45
|
|
64
|
-
|
46
|
+
BOOST_THREAD_DECL void __cdecl on_thread_exit(void);
|
65
47
|
//Function to be called just be fore a thread ends
|
66
48
|
//in an exe or dll that uses Boost.Threads.
|
67
49
|
//Must be called in the context of the thread
|
@@ -70,10 +52,11 @@
|
|
70
52
|
//a method for doing so has been discovered.
|
71
53
|
//Must not be omitted; may be called multiple times.
|
72
54
|
|
73
|
-
|
55
|
+
void tss_cleanup_implemented();
|
74
56
|
//Dummy function used both to detect whether tss cleanup
|
75
57
|
//cleanup has been implemented and to force
|
76
58
|
//it to be linked into the Boost.Threads library.
|
59
|
+
}
|
77
60
|
|
78
61
|
#endif //defined(BOOST_HAS_WINTHREADS)
|
79
62
|
|
data/ext/boost/thread/future.hpp
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
// (C) Copyright 2008-
|
1
|
+
// (C) Copyright 2008-10 Anthony Williams
|
2
2
|
//
|
3
3
|
// Distributed under the Boost Software License, Version 1.0. (See
|
4
4
|
// accompanying file LICENSE_1_0.txt or copy at
|
@@ -9,6 +9,8 @@
|
|
9
9
|
#include <stdexcept>
|
10
10
|
#include <boost/thread/detail/move.hpp>
|
11
11
|
#include <boost/thread/thread_time.hpp>
|
12
|
+
#include <boost/thread/mutex.hpp>
|
13
|
+
#include <boost/thread/condition_variable.hpp>
|
12
14
|
#include <boost/exception_ptr.hpp>
|
13
15
|
#include <boost/shared_ptr.hpp>
|
14
16
|
#include <boost/scoped_ptr.hpp>
|
@@ -16,6 +18,7 @@
|
|
16
18
|
#include <boost/type_traits/is_convertible.hpp>
|
17
19
|
#include <boost/mpl/if.hpp>
|
18
20
|
#include <boost/config.hpp>
|
21
|
+
#include <boost/throw_exception.hpp>
|
19
22
|
#include <algorithm>
|
20
23
|
#include <boost/function.hpp>
|
21
24
|
#include <boost/bind.hpp>
|
@@ -139,6 +142,8 @@ namespace boost
|
|
139
142
|
{
|
140
143
|
lock.lock();
|
141
144
|
}
|
145
|
+
private:
|
146
|
+
relocker& operator=(relocker const&);
|
142
147
|
};
|
143
148
|
|
144
149
|
void do_callback(boost::unique_lock<boost::mutex>& lock)
|
@@ -218,7 +223,7 @@ namespace boost
|
|
218
223
|
struct future_traits
|
219
224
|
{
|
220
225
|
typedef boost::scoped_ptr<T> storage_type;
|
221
|
-
#
|
226
|
+
#ifndef BOOST_NO_RVALUE_REFERENCES
|
222
227
|
typedef T const& source_reference_type;
|
223
228
|
struct dummy;
|
224
229
|
typedef typename boost::mpl::if_<boost::is_fundamental<T>,dummy&,T&&>::type rvalue_source_type;
|
@@ -323,7 +328,7 @@ namespace boost
|
|
323
328
|
move_dest_type get()
|
324
329
|
{
|
325
330
|
wait();
|
326
|
-
return *result;
|
331
|
+
return static_cast<move_dest_type>(*result);
|
327
332
|
}
|
328
333
|
|
329
334
|
future_state::state get_state()
|
@@ -387,15 +392,18 @@ namespace boost
|
|
387
392
|
|
388
393
|
class future_waiter
|
389
394
|
{
|
395
|
+
struct registered_waiter;
|
396
|
+
typedef std::vector<registered_waiter>::size_type count_type;
|
397
|
+
|
390
398
|
struct registered_waiter
|
391
399
|
{
|
392
400
|
boost::shared_ptr<detail::future_object_base> future;
|
393
401
|
detail::future_object_base::waiter_list::iterator wait_iterator;
|
394
|
-
|
402
|
+
count_type index;
|
395
403
|
|
396
404
|
registered_waiter(boost::shared_ptr<detail::future_object_base> const& future_,
|
397
405
|
detail::future_object_base::waiter_list::iterator wait_iterator_,
|
398
|
-
|
406
|
+
count_type index_):
|
399
407
|
future(future_),wait_iterator(wait_iterator_),index(index_)
|
400
408
|
{}
|
401
409
|
|
@@ -403,13 +411,13 @@ namespace boost
|
|
403
411
|
|
404
412
|
struct all_futures_lock
|
405
413
|
{
|
406
|
-
|
414
|
+
count_type count;
|
407
415
|
boost::scoped_array<boost::unique_lock<boost::mutex> > locks;
|
408
416
|
|
409
417
|
all_futures_lock(std::vector<registered_waiter>& futures):
|
410
418
|
count(futures.size()),locks(new boost::unique_lock<boost::mutex>[count])
|
411
419
|
{
|
412
|
-
for(
|
420
|
+
for(count_type i=0;i<count;++i)
|
413
421
|
{
|
414
422
|
locks[i]=boost::unique_lock<boost::mutex>(futures[i].future->mutex);
|
415
423
|
}
|
@@ -422,7 +430,7 @@ namespace boost
|
|
422
430
|
|
423
431
|
void unlock()
|
424
432
|
{
|
425
|
-
for(
|
433
|
+
for(count_type i=0;i<count;++i)
|
426
434
|
{
|
427
435
|
locks[i].unlock();
|
428
436
|
}
|
@@ -431,7 +439,7 @@ namespace boost
|
|
431
439
|
|
432
440
|
boost::condition_variable_any cv;
|
433
441
|
std::vector<registered_waiter> futures;
|
434
|
-
|
442
|
+
count_type future_count;
|
435
443
|
|
436
444
|
public:
|
437
445
|
future_waiter():
|
@@ -448,12 +456,12 @@ namespace boost
|
|
448
456
|
++future_count;
|
449
457
|
}
|
450
458
|
|
451
|
-
|
459
|
+
count_type wait()
|
452
460
|
{
|
453
461
|
all_futures_lock lk(futures);
|
454
462
|
for(;;)
|
455
463
|
{
|
456
|
-
for(
|
464
|
+
for(count_type i=0;i<futures.size();++i)
|
457
465
|
{
|
458
466
|
if(futures[i].future->done)
|
459
467
|
{
|
@@ -466,7 +474,7 @@ namespace boost
|
|
466
474
|
|
467
475
|
~future_waiter()
|
468
476
|
{
|
469
|
-
for(
|
477
|
+
for(count_type i=0;i<futures.size();++i)
|
470
478
|
{
|
471
479
|
futures[i].future->remove_external_waiter(futures[i].wait_iterator);
|
472
480
|
}
|
@@ -546,6 +554,9 @@ namespace boost
|
|
546
554
|
template<typename Iterator>
|
547
555
|
typename boost::disable_if<is_future_type<Iterator>,Iterator>::type wait_for_any(Iterator begin,Iterator end)
|
548
556
|
{
|
557
|
+
if(begin==end)
|
558
|
+
return end;
|
559
|
+
|
549
560
|
detail::future_waiter waiter;
|
550
561
|
for(Iterator current=begin;current!=end;++current)
|
551
562
|
{
|
@@ -632,7 +643,7 @@ namespace boost
|
|
632
643
|
~unique_future()
|
633
644
|
{}
|
634
645
|
|
635
|
-
#
|
646
|
+
#ifndef BOOST_NO_RVALUE_REFERENCES
|
636
647
|
unique_future(unique_future && other)
|
637
648
|
{
|
638
649
|
future.swap(other.future);
|
@@ -673,7 +684,7 @@ namespace boost
|
|
673
684
|
{
|
674
685
|
if(!future)
|
675
686
|
{
|
676
|
-
|
687
|
+
boost::throw_exception(future_uninitialized());
|
677
688
|
}
|
678
689
|
|
679
690
|
return future->get();
|
@@ -709,7 +720,7 @@ namespace boost
|
|
709
720
|
{
|
710
721
|
if(!future)
|
711
722
|
{
|
712
|
-
|
723
|
+
boost::throw_exception(future_uninitialized());
|
713
724
|
}
|
714
725
|
future->wait(false);
|
715
726
|
}
|
@@ -724,7 +735,7 @@ namespace boost
|
|
724
735
|
{
|
725
736
|
if(!future)
|
726
737
|
{
|
727
|
-
|
738
|
+
boost::throw_exception(future_uninitialized());
|
728
739
|
}
|
729
740
|
return future->timed_wait_until(abs_time);
|
730
741
|
}
|
@@ -767,7 +778,7 @@ namespace boost
|
|
767
778
|
future=other.future;
|
768
779
|
return *this;
|
769
780
|
}
|
770
|
-
#
|
781
|
+
#ifndef BOOST_NO_RVALUE_REFERENCES
|
771
782
|
shared_future(shared_future && other)
|
772
783
|
{
|
773
784
|
future.swap(other.future);
|
@@ -830,7 +841,7 @@ namespace boost
|
|
830
841
|
{
|
831
842
|
if(!future)
|
832
843
|
{
|
833
|
-
|
844
|
+
boost::throw_exception(future_uninitialized());
|
834
845
|
}
|
835
846
|
|
836
847
|
return future->get();
|
@@ -866,7 +877,7 @@ namespace boost
|
|
866
877
|
{
|
867
878
|
if(!future)
|
868
879
|
{
|
869
|
-
|
880
|
+
boost::throw_exception(future_uninitialized());
|
870
881
|
}
|
871
882
|
future->wait(false);
|
872
883
|
}
|
@@ -881,7 +892,7 @@ namespace boost
|
|
881
892
|
{
|
882
893
|
if(!future)
|
883
894
|
{
|
884
|
-
|
895
|
+
boost::throw_exception(future_uninitialized());
|
885
896
|
}
|
886
897
|
return future->timed_wait_until(abs_time);
|
887
898
|
}
|
@@ -929,7 +940,7 @@ namespace boost
|
|
929
940
|
}
|
930
941
|
|
931
942
|
// Assignment
|
932
|
-
#
|
943
|
+
#ifndef BOOST_NO_RVALUE_REFERENCES
|
933
944
|
promise(promise && rhs):
|
934
945
|
future_obtained(rhs.future_obtained)
|
935
946
|
{
|
@@ -974,7 +985,7 @@ namespace boost
|
|
974
985
|
lazy_init();
|
975
986
|
if(future_obtained)
|
976
987
|
{
|
977
|
-
|
988
|
+
boost::throw_exception(future_already_retrieved());
|
978
989
|
}
|
979
990
|
future_obtained=true;
|
980
991
|
return unique_future<R>(future);
|
@@ -986,7 +997,7 @@ namespace boost
|
|
986
997
|
boost::lock_guard<boost::mutex> lock(future->mutex);
|
987
998
|
if(future->done)
|
988
999
|
{
|
989
|
-
|
1000
|
+
boost::throw_exception(promise_already_satisfied());
|
990
1001
|
}
|
991
1002
|
future->mark_finished_with_result_internal(r);
|
992
1003
|
}
|
@@ -998,7 +1009,7 @@ namespace boost
|
|
998
1009
|
boost::lock_guard<boost::mutex> lock(future->mutex);
|
999
1010
|
if(future->done)
|
1000
1011
|
{
|
1001
|
-
|
1012
|
+
boost::throw_exception(promise_already_satisfied());
|
1002
1013
|
}
|
1003
1014
|
future->mark_finished_with_result_internal(static_cast<typename detail::future_traits<R>::rvalue_source_type>(r));
|
1004
1015
|
}
|
@@ -1009,7 +1020,7 @@ namespace boost
|
|
1009
1020
|
boost::lock_guard<boost::mutex> lock(future->mutex);
|
1010
1021
|
if(future->done)
|
1011
1022
|
{
|
1012
|
-
|
1023
|
+
boost::throw_exception(promise_already_satisfied());
|
1013
1024
|
}
|
1014
1025
|
future->mark_exceptional_finish_internal(p);
|
1015
1026
|
}
|
@@ -1063,7 +1074,7 @@ namespace boost
|
|
1063
1074
|
}
|
1064
1075
|
|
1065
1076
|
// Assignment
|
1066
|
-
#
|
1077
|
+
#ifndef BOOST_NO_RVALUE_REFERENCES
|
1067
1078
|
promise(promise && rhs):
|
1068
1079
|
future_obtained(rhs.future_obtained)
|
1069
1080
|
{
|
@@ -1109,7 +1120,7 @@ namespace boost
|
|
1109
1120
|
|
1110
1121
|
if(future_obtained)
|
1111
1122
|
{
|
1112
|
-
|
1123
|
+
boost::throw_exception(future_already_retrieved());
|
1113
1124
|
}
|
1114
1125
|
future_obtained=true;
|
1115
1126
|
return unique_future<void>(future);
|
@@ -1121,7 +1132,7 @@ namespace boost
|
|
1121
1132
|
boost::lock_guard<boost::mutex> lock(future->mutex);
|
1122
1133
|
if(future->done)
|
1123
1134
|
{
|
1124
|
-
|
1135
|
+
boost::throw_exception(promise_already_satisfied());
|
1125
1136
|
}
|
1126
1137
|
future->mark_finished_with_result_internal();
|
1127
1138
|
}
|
@@ -1132,7 +1143,7 @@ namespace boost
|
|
1132
1143
|
boost::lock_guard<boost::mutex> lock(future->mutex);
|
1133
1144
|
if(future->done)
|
1134
1145
|
{
|
1135
|
-
|
1146
|
+
boost::throw_exception(promise_already_satisfied());
|
1136
1147
|
}
|
1137
1148
|
future->mark_exceptional_finish_internal(p);
|
1138
1149
|
}
|
@@ -1164,7 +1175,7 @@ namespace boost
|
|
1164
1175
|
boost::lock_guard<boost::mutex> lk(this->mutex);
|
1165
1176
|
if(started)
|
1166
1177
|
{
|
1167
|
-
|
1178
|
+
boost::throw_exception(task_already_started());
|
1168
1179
|
}
|
1169
1180
|
started=true;
|
1170
1181
|
}
|
@@ -1283,7 +1294,7 @@ namespace boost
|
|
1283
1294
|
}
|
1284
1295
|
|
1285
1296
|
// assignment
|
1286
|
-
#
|
1297
|
+
#ifndef BOOST_NO_RVALUE_REFERENCES
|
1287
1298
|
packaged_task(packaged_task&& other):
|
1288
1299
|
future_obtained(other.future_obtained)
|
1289
1300
|
{
|
@@ -1326,7 +1337,7 @@ namespace boost
|
|
1326
1337
|
{
|
1327
1338
|
if(!task)
|
1328
1339
|
{
|
1329
|
-
|
1340
|
+
boost::throw_exception(task_moved());
|
1330
1341
|
}
|
1331
1342
|
else if(!future_obtained)
|
1332
1343
|
{
|
@@ -1335,7 +1346,7 @@ namespace boost
|
|
1335
1346
|
}
|
1336
1347
|
else
|
1337
1348
|
{
|
1338
|
-
|
1349
|
+
boost::throw_exception(future_already_retrieved());
|
1339
1350
|
}
|
1340
1351
|
}
|
1341
1352
|
|
@@ -1345,7 +1356,7 @@ namespace boost
|
|
1345
1356
|
{
|
1346
1357
|
if(!task)
|
1347
1358
|
{
|
1348
|
-
|
1359
|
+
boost::throw_exception(task_moved());
|
1349
1360
|
}
|
1350
1361
|
task->run();
|
1351
1362
|
}
|
data/ext/boost/thread/locks.hpp
CHANGED
@@ -11,6 +11,7 @@
|
|
11
11
|
#include <iterator>
|
12
12
|
#include <boost/thread/thread_time.hpp>
|
13
13
|
#include <boost/detail/workaround.hpp>
|
14
|
+
#include <boost/type_traits/is_class.hpp>
|
14
15
|
|
15
16
|
#include <boost/config/abi_prefix.hpp>
|
16
17
|
|
@@ -27,8 +28,52 @@ namespace boost
|
|
27
28
|
#ifndef BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES
|
28
29
|
namespace detail
|
29
30
|
{
|
30
|
-
|
31
|
+
#define BOOST_DEFINE_HAS_MEMBER_CALLED(member_name) \
|
32
|
+
template<typename T, bool=boost::is_class<T>::value> \
|
33
|
+
struct has_member_called_##member_name \
|
34
|
+
{ \
|
35
|
+
BOOST_STATIC_CONSTANT(bool, value=false); \
|
36
|
+
}; \
|
37
|
+
\
|
38
|
+
template<typename T> \
|
39
|
+
struct has_member_called_##member_name<T,true> \
|
40
|
+
{ \
|
41
|
+
typedef char true_type; \
|
42
|
+
struct false_type \
|
43
|
+
{ \
|
44
|
+
true_type dummy[2]; \
|
45
|
+
}; \
|
46
|
+
\
|
47
|
+
struct fallback { int member_name; }; \
|
48
|
+
struct derived: \
|
49
|
+
T, fallback \
|
50
|
+
{ \
|
51
|
+
derived(); \
|
52
|
+
}; \
|
53
|
+
\
|
54
|
+
template<int fallback::*> struct tester; \
|
55
|
+
\
|
56
|
+
template<typename U> \
|
57
|
+
static false_type has_member(tester<&U::member_name>*); \
|
58
|
+
template<typename U> \
|
59
|
+
static true_type has_member(...); \
|
60
|
+
\
|
61
|
+
BOOST_STATIC_CONSTANT( \
|
62
|
+
bool, value=sizeof(has_member<derived>(0))==sizeof(true_type)); \
|
63
|
+
}
|
64
|
+
|
65
|
+
BOOST_DEFINE_HAS_MEMBER_CALLED(lock);
|
66
|
+
BOOST_DEFINE_HAS_MEMBER_CALLED(unlock);
|
67
|
+
BOOST_DEFINE_HAS_MEMBER_CALLED(try_lock);
|
68
|
+
|
69
|
+
template<typename T,bool=has_member_called_lock<T>::value >
|
31
70
|
struct has_member_lock
|
71
|
+
{
|
72
|
+
BOOST_STATIC_CONSTANT(bool, value=false);
|
73
|
+
};
|
74
|
+
|
75
|
+
template<typename T>
|
76
|
+
struct has_member_lock<T,true>
|
32
77
|
{
|
33
78
|
typedef char true_type;
|
34
79
|
struct false_type
|
@@ -36,15 +81,23 @@ namespace boost
|
|
36
81
|
true_type dummy[2];
|
37
82
|
};
|
38
83
|
|
84
|
+
template<typename U,typename V>
|
85
|
+
static true_type has_member(V (U::*)());
|
39
86
|
template<typename U>
|
40
|
-
static
|
41
|
-
static false_type has_member(void*);
|
87
|
+
static false_type has_member(U);
|
42
88
|
|
43
|
-
BOOST_STATIC_CONSTANT(
|
89
|
+
BOOST_STATIC_CONSTANT(
|
90
|
+
bool,value=sizeof(has_member_lock<T>::has_member(&T::lock))==sizeof(true_type));
|
44
91
|
};
|
45
|
-
|
46
|
-
template<typename T>
|
92
|
+
|
93
|
+
template<typename T,bool=has_member_called_unlock<T>::value >
|
47
94
|
struct has_member_unlock
|
95
|
+
{
|
96
|
+
BOOST_STATIC_CONSTANT(bool, value=false);
|
97
|
+
};
|
98
|
+
|
99
|
+
template<typename T>
|
100
|
+
struct has_member_unlock<T,true>
|
48
101
|
{
|
49
102
|
typedef char true_type;
|
50
103
|
struct false_type
|
@@ -52,15 +105,23 @@ namespace boost
|
|
52
105
|
true_type dummy[2];
|
53
106
|
};
|
54
107
|
|
108
|
+
template<typename U,typename V>
|
109
|
+
static true_type has_member(V (U::*)());
|
55
110
|
template<typename U>
|
56
|
-
static
|
57
|
-
static false_type has_member(void*);
|
111
|
+
static false_type has_member(U);
|
58
112
|
|
59
|
-
BOOST_STATIC_CONSTANT(
|
113
|
+
BOOST_STATIC_CONSTANT(
|
114
|
+
bool,value=sizeof(has_member_unlock<T>::has_member(&T::unlock))==sizeof(true_type));
|
60
115
|
};
|
61
116
|
|
62
|
-
template<typename T>
|
117
|
+
template<typename T,bool=has_member_called_try_lock<T>::value >
|
63
118
|
struct has_member_try_lock
|
119
|
+
{
|
120
|
+
BOOST_STATIC_CONSTANT(bool, value=false);
|
121
|
+
};
|
122
|
+
|
123
|
+
template<typename T>
|
124
|
+
struct has_member_try_lock<T,true>
|
64
125
|
{
|
65
126
|
typedef char true_type;
|
66
127
|
struct false_type
|
@@ -69,10 +130,12 @@ namespace boost
|
|
69
130
|
};
|
70
131
|
|
71
132
|
template<typename U>
|
72
|
-
static true_type has_member(
|
73
|
-
|
133
|
+
static true_type has_member(bool (U::*)());
|
134
|
+
template<typename U>
|
135
|
+
static false_type has_member(U);
|
74
136
|
|
75
|
-
BOOST_STATIC_CONSTANT(
|
137
|
+
BOOST_STATIC_CONSTANT(
|
138
|
+
bool,value=sizeof(has_member_try_lock<T>::has_member(&T::try_lock))==sizeof(true_type));
|
76
139
|
};
|
77
140
|
|
78
141
|
}
|
@@ -214,7 +277,7 @@ namespace boost
|
|
214
277
|
unique_lock& operator=(unique_lock&);
|
215
278
|
unique_lock& operator=(upgrade_lock<Mutex>& other);
|
216
279
|
public:
|
217
|
-
#
|
280
|
+
#if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)
|
218
281
|
unique_lock(const volatile unique_lock&);
|
219
282
|
#endif
|
220
283
|
unique_lock():
|
@@ -248,7 +311,7 @@ namespace boost
|
|
248
311
|
{
|
249
312
|
timed_lock(target_time);
|
250
313
|
}
|
251
|
-
#
|
314
|
+
#ifndef BOOST_NO_RVALUE_REFERENCES
|
252
315
|
unique_lock(unique_lock&& other):
|
253
316
|
m(other.m),is_locked(other.is_locked)
|
254
317
|
{
|
@@ -300,7 +363,7 @@ namespace boost
|
|
300
363
|
return detail::thread_move_t<unique_lock<Mutex> >(*this);
|
301
364
|
}
|
302
365
|
|
303
|
-
#
|
366
|
+
#if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)
|
304
367
|
unique_lock& operator=(unique_lock<Mutex> other)
|
305
368
|
{
|
306
369
|
swap(other);
|
@@ -321,17 +384,17 @@ namespace boost
|
|
321
384
|
swap(temp);
|
322
385
|
return *this;
|
323
386
|
}
|
324
|
-
void swap(unique_lock& other)
|
325
|
-
{
|
326
|
-
std::swap(m,other.m);
|
327
|
-
std::swap(is_locked,other.is_locked);
|
328
|
-
}
|
329
387
|
void swap(detail::thread_move_t<unique_lock<Mutex> > other)
|
330
388
|
{
|
331
389
|
std::swap(m,other->m);
|
332
390
|
std::swap(is_locked,other->is_locked);
|
333
391
|
}
|
334
392
|
#endif
|
393
|
+
void swap(unique_lock& other)
|
394
|
+
{
|
395
|
+
std::swap(m,other.m);
|
396
|
+
std::swap(is_locked,other.is_locked);
|
397
|
+
}
|
335
398
|
|
336
399
|
~unique_lock()
|
337
400
|
{
|
@@ -344,7 +407,7 @@ namespace boost
|
|
344
407
|
{
|
345
408
|
if(owns_lock())
|
346
409
|
{
|
347
|
-
|
410
|
+
boost::throw_exception(boost::lock_error());
|
348
411
|
}
|
349
412
|
m->lock();
|
350
413
|
is_locked=true;
|
@@ -353,7 +416,7 @@ namespace boost
|
|
353
416
|
{
|
354
417
|
if(owns_lock())
|
355
418
|
{
|
356
|
-
|
419
|
+
boost::throw_exception(boost::lock_error());
|
357
420
|
}
|
358
421
|
is_locked=m->try_lock();
|
359
422
|
return is_locked;
|
@@ -379,7 +442,7 @@ namespace boost
|
|
379
442
|
{
|
380
443
|
if(!owns_lock())
|
381
444
|
{
|
382
|
-
|
445
|
+
boost::throw_exception(boost::lock_error());
|
383
446
|
}
|
384
447
|
m->unlock();
|
385
448
|
is_locked=false;
|
@@ -416,25 +479,42 @@ namespace boost
|
|
416
479
|
friend class upgrade_lock<Mutex>;
|
417
480
|
};
|
418
481
|
|
419
|
-
#
|
482
|
+
#ifndef BOOST_NO_RVALUE_REFERENCES
|
420
483
|
template<typename Mutex>
|
421
484
|
void swap(unique_lock<Mutex>&& lhs,unique_lock<Mutex>&& rhs)
|
422
485
|
{
|
423
486
|
lhs.swap(rhs);
|
424
487
|
}
|
425
|
-
|
488
|
+
|
489
|
+
template<typename Mutex>
|
490
|
+
inline upgrade_lock<Mutex>&& move(upgrade_lock<Mutex>&& ul)
|
491
|
+
{
|
492
|
+
return static_cast<upgrade_lock<Mutex>&&>(ul);
|
493
|
+
}
|
494
|
+
|
495
|
+
template<typename Mutex>
|
496
|
+
inline upgrade_lock<Mutex>&& move(upgrade_lock<Mutex>& ul)
|
497
|
+
{
|
498
|
+
return static_cast<upgrade_lock<Mutex>&&>(ul);
|
499
|
+
}
|
500
|
+
#endif
|
426
501
|
template<typename Mutex>
|
427
502
|
void swap(unique_lock<Mutex>& lhs,unique_lock<Mutex>& rhs)
|
428
503
|
{
|
429
504
|
lhs.swap(rhs);
|
430
505
|
}
|
431
|
-
#endif
|
432
506
|
|
433
|
-
#
|
507
|
+
#ifndef BOOST_NO_RVALUE_REFERENCES
|
434
508
|
template<typename Mutex>
|
435
509
|
inline unique_lock<Mutex>&& move(unique_lock<Mutex>&& ul)
|
436
510
|
{
|
437
|
-
return ul;
|
511
|
+
return static_cast<unique_lock<Mutex>&&>(ul);
|
512
|
+
}
|
513
|
+
|
514
|
+
template<typename Mutex>
|
515
|
+
inline unique_lock<Mutex>&& move(unique_lock<Mutex>& ul)
|
516
|
+
{
|
517
|
+
return static_cast<unique_lock<Mutex>&&>(ul);
|
438
518
|
}
|
439
519
|
#endif
|
440
520
|
|
@@ -535,24 +615,24 @@ namespace boost
|
|
535
615
|
return *this;
|
536
616
|
}
|
537
617
|
|
538
|
-
#
|
618
|
+
#ifndef BOOST_NO_RVALUE_REFERENCES
|
539
619
|
void swap(shared_lock&& other)
|
540
620
|
{
|
541
621
|
std::swap(m,other.m);
|
542
622
|
std::swap(is_locked,other.is_locked);
|
543
623
|
}
|
544
624
|
#else
|
545
|
-
void swap(shared_lock& other)
|
546
|
-
{
|
547
|
-
std::swap(m,other.m);
|
548
|
-
std::swap(is_locked,other.is_locked);
|
549
|
-
}
|
550
625
|
void swap(boost::detail::thread_move_t<shared_lock<Mutex> > other)
|
551
626
|
{
|
552
627
|
std::swap(m,other->m);
|
553
628
|
std::swap(is_locked,other->is_locked);
|
554
629
|
}
|
555
630
|
#endif
|
631
|
+
void swap(shared_lock& other)
|
632
|
+
{
|
633
|
+
std::swap(m,other.m);
|
634
|
+
std::swap(is_locked,other.is_locked);
|
635
|
+
}
|
556
636
|
|
557
637
|
Mutex* mutex() const
|
558
638
|
{
|
@@ -570,7 +650,7 @@ namespace boost
|
|
570
650
|
{
|
571
651
|
if(owns_lock())
|
572
652
|
{
|
573
|
-
|
653
|
+
boost::throw_exception(boost::lock_error());
|
574
654
|
}
|
575
655
|
m->lock_shared();
|
576
656
|
is_locked=true;
|
@@ -579,7 +659,7 @@ namespace boost
|
|
579
659
|
{
|
580
660
|
if(owns_lock())
|
581
661
|
{
|
582
|
-
|
662
|
+
boost::throw_exception(boost::lock_error());
|
583
663
|
}
|
584
664
|
is_locked=m->try_lock_shared();
|
585
665
|
return is_locked;
|
@@ -588,7 +668,7 @@ namespace boost
|
|
588
668
|
{
|
589
669
|
if(owns_lock())
|
590
670
|
{
|
591
|
-
|
671
|
+
boost::throw_exception(boost::lock_error());
|
592
672
|
}
|
593
673
|
is_locked=m->timed_lock_shared(target_time);
|
594
674
|
return is_locked;
|
@@ -598,7 +678,7 @@ namespace boost
|
|
598
678
|
{
|
599
679
|
if(owns_lock())
|
600
680
|
{
|
601
|
-
|
681
|
+
boost::throw_exception(boost::lock_error());
|
602
682
|
}
|
603
683
|
is_locked=m->timed_lock_shared(target_time);
|
604
684
|
return is_locked;
|
@@ -607,7 +687,7 @@ namespace boost
|
|
607
687
|
{
|
608
688
|
if(!owns_lock())
|
609
689
|
{
|
610
|
-
|
690
|
+
boost::throw_exception(boost::lock_error());
|
611
691
|
}
|
612
692
|
m->unlock_shared();
|
613
693
|
is_locked=false;
|
@@ -629,7 +709,7 @@ namespace boost
|
|
629
709
|
|
630
710
|
};
|
631
711
|
|
632
|
-
#
|
712
|
+
#ifndef BOOST_NO_RVALUE_REFERENCES
|
633
713
|
template<typename Mutex>
|
634
714
|
void swap(shared_lock<Mutex>&& lhs,shared_lock<Mutex>&& rhs)
|
635
715
|
{
|
@@ -673,6 +753,39 @@ namespace boost
|
|
673
753
|
{
|
674
754
|
try_lock();
|
675
755
|
}
|
756
|
+
#ifdef BOOST_HAS_RVALUE_REFS
|
757
|
+
upgrade_lock(upgrade_lock<Mutex>&& other):
|
758
|
+
m(other.m),is_locked(other.is_locked)
|
759
|
+
{
|
760
|
+
other.is_locked=false;
|
761
|
+
other.m=0;
|
762
|
+
}
|
763
|
+
|
764
|
+
upgrade_lock(unique_lock<Mutex>&& other):
|
765
|
+
m(other.m),is_locked(other.is_locked)
|
766
|
+
{
|
767
|
+
if(is_locked)
|
768
|
+
{
|
769
|
+
m->unlock_and_lock_upgrade();
|
770
|
+
}
|
771
|
+
other.is_locked=false;
|
772
|
+
other.m=0;
|
773
|
+
}
|
774
|
+
|
775
|
+
upgrade_lock& operator=(upgrade_lock<Mutex>&& other)
|
776
|
+
{
|
777
|
+
upgrade_lock temp(static_cast<upgrade_lock<Mutex>&&>(other));
|
778
|
+
swap(temp);
|
779
|
+
return *this;
|
780
|
+
}
|
781
|
+
|
782
|
+
upgrade_lock& operator=(unique_lock<Mutex>&& other)
|
783
|
+
{
|
784
|
+
upgrade_lock temp(static_cast<unique_lock<Mutex>&&>(other));
|
785
|
+
swap(temp);
|
786
|
+
return *this;
|
787
|
+
}
|
788
|
+
#else
|
676
789
|
upgrade_lock(detail::thread_move_t<upgrade_lock<Mutex> > other):
|
677
790
|
m(other->m),is_locked(other->is_locked)
|
678
791
|
{
|
@@ -715,6 +828,7 @@ namespace boost
|
|
715
828
|
swap(temp);
|
716
829
|
return *this;
|
717
830
|
}
|
831
|
+
#endif
|
718
832
|
|
719
833
|
void swap(upgrade_lock& other)
|
720
834
|
{
|
@@ -733,7 +847,7 @@ namespace boost
|
|
733
847
|
{
|
734
848
|
if(owns_lock())
|
735
849
|
{
|
736
|
-
|
850
|
+
boost::throw_exception(boost::lock_error());
|
737
851
|
}
|
738
852
|
m->lock_upgrade();
|
739
853
|
is_locked=true;
|
@@ -742,7 +856,7 @@ namespace boost
|
|
742
856
|
{
|
743
857
|
if(owns_lock())
|
744
858
|
{
|
745
|
-
|
859
|
+
boost::throw_exception(boost::lock_error());
|
746
860
|
}
|
747
861
|
is_locked=m->try_lock_upgrade();
|
748
862
|
return is_locked;
|
@@ -751,7 +865,7 @@ namespace boost
|
|
751
865
|
{
|
752
866
|
if(!owns_lock())
|
753
867
|
{
|
754
|
-
|
868
|
+
boost::throw_exception(boost::lock_error());
|
755
869
|
}
|
756
870
|
m->unlock_upgrade();
|
757
871
|
is_locked=false;
|
@@ -775,7 +889,7 @@ namespace boost
|
|
775
889
|
};
|
776
890
|
|
777
891
|
|
778
|
-
#
|
892
|
+
#ifndef BOOST_NO_RVALUE_REFERENCES
|
779
893
|
template<typename Mutex>
|
780
894
|
unique_lock<Mutex>::unique_lock(upgrade_lock<Mutex>&& other):
|
781
895
|
m(other.m),is_locked(other.is_locked)
|
@@ -819,6 +933,20 @@ namespace boost
|
|
819
933
|
}
|
820
934
|
}
|
821
935
|
|
936
|
+
#ifdef BOOST_HAS_RVALUE_REFS
|
937
|
+
upgrade_to_unique_lock(upgrade_to_unique_lock<Mutex>&& other):
|
938
|
+
source(other.source),exclusive(move(other.exclusive))
|
939
|
+
{
|
940
|
+
other.source=0;
|
941
|
+
}
|
942
|
+
|
943
|
+
upgrade_to_unique_lock& operator=(upgrade_to_unique_lock<Mutex>&& other)
|
944
|
+
{
|
945
|
+
upgrade_to_unique_lock temp(other);
|
946
|
+
swap(temp);
|
947
|
+
return *this;
|
948
|
+
}
|
949
|
+
#else
|
822
950
|
upgrade_to_unique_lock(detail::thread_move_t<upgrade_to_unique_lock<Mutex> > other):
|
823
951
|
source(other->source),exclusive(move(other->exclusive))
|
824
952
|
{
|
@@ -831,6 +959,7 @@ namespace boost
|
|
831
959
|
swap(temp);
|
832
960
|
return *this;
|
833
961
|
}
|
962
|
+
#endif
|
834
963
|
void swap(upgrade_to_unique_lock& other)
|
835
964
|
{
|
836
965
|
std::swap(source,other.source);
|
@@ -875,7 +1004,7 @@ namespace boost
|
|
875
1004
|
try_lock_wrapper(Mutex& m_,try_to_lock_t):
|
876
1005
|
base(m_,try_to_lock)
|
877
1006
|
{}
|
878
|
-
#
|
1007
|
+
#ifndef BOOST_NO_RVALUE_REFERENCES
|
879
1008
|
try_lock_wrapper(try_lock_wrapper&& other):
|
880
1009
|
base(other.move())
|
881
1010
|
{}
|
@@ -918,15 +1047,15 @@ namespace boost
|
|
918
1047
|
return *this;
|
919
1048
|
}
|
920
1049
|
|
921
|
-
void swap(try_lock_wrapper& other)
|
922
|
-
{
|
923
|
-
base::swap(other);
|
924
|
-
}
|
925
1050
|
void swap(detail::thread_move_t<try_lock_wrapper<Mutex> > other)
|
926
1051
|
{
|
927
1052
|
base::swap(*other);
|
928
1053
|
}
|
929
1054
|
#endif
|
1055
|
+
void swap(try_lock_wrapper& other)
|
1056
|
+
{
|
1057
|
+
base::swap(other);
|
1058
|
+
}
|
930
1059
|
void lock()
|
931
1060
|
{
|
932
1061
|
base::lock();
|
@@ -963,7 +1092,7 @@ namespace boost
|
|
963
1092
|
}
|
964
1093
|
};
|
965
1094
|
|
966
|
-
#
|
1095
|
+
#ifndef BOOST_NO_RVALUE_REFERENCES
|
967
1096
|
template<typename Mutex>
|
968
1097
|
void swap(try_lock_wrapper<Mutex>&& lhs,try_lock_wrapper<Mutex>&& rhs)
|
969
1098
|
{
|
@@ -1111,7 +1240,7 @@ namespace boost
|
|
1111
1240
|
{
|
1112
1241
|
unsigned const lock_count=2;
|
1113
1242
|
unsigned lock_first=0;
|
1114
|
-
|
1243
|
+
for(;;)
|
1115
1244
|
{
|
1116
1245
|
switch(lock_first)
|
1117
1246
|
{
|
@@ -1164,7 +1293,7 @@ namespace boost
|
|
1164
1293
|
{
|
1165
1294
|
unsigned const lock_count=3;
|
1166
1295
|
unsigned lock_first=0;
|
1167
|
-
|
1296
|
+
for(;;)
|
1168
1297
|
{
|
1169
1298
|
switch(lock_first)
|
1170
1299
|
{
|
@@ -1196,7 +1325,7 @@ namespace boost
|
|
1196
1325
|
{
|
1197
1326
|
unsigned const lock_count=4;
|
1198
1327
|
unsigned lock_first=0;
|
1199
|
-
|
1328
|
+
for(;;)
|
1200
1329
|
{
|
1201
1330
|
switch(lock_first)
|
1202
1331
|
{
|
@@ -1234,7 +1363,7 @@ namespace boost
|
|
1234
1363
|
{
|
1235
1364
|
unsigned const lock_count=5;
|
1236
1365
|
unsigned lock_first=0;
|
1237
|
-
|
1366
|
+
for(;;)
|
1238
1367
|
{
|
1239
1368
|
switch(lock_first)
|
1240
1369
|
{
|