mirror of
https://github.com/boostorg/thread.git
synced 2026-02-08 23:22:13 +00:00
Compare commits
15 Commits
boost-1.35
...
svn-branch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c86959afb7 | ||
|
|
8b302dbb4f | ||
|
|
43943faf5c | ||
|
|
f934c01bdf | ||
|
|
5af025cdce | ||
|
|
1b56fe63d1 | ||
|
|
d460417a09 | ||
|
|
67ce920ab8 | ||
|
|
b50a7ccb61 | ||
|
|
f827709d42 | ||
|
|
36abb42175 | ||
|
|
40f3b1b4c8 | ||
|
|
4f35e25688 | ||
|
|
270e88edd7 | ||
|
|
5ded171247 |
@@ -45,7 +45,7 @@ last-revision="$Date$">
|
||||
<biblioentry id="thread.bib.Boost">
|
||||
<abbrev id="thread.bib.Boost.abbrev">Boost</abbrev>
|
||||
<bibliomisc>The <emphasis>Boost</emphasis> world wide web site.
|
||||
<ulink url="http:/www.boost.org">http://www.boost.org</ulink></bibliomisc>
|
||||
<ulink url="http://www.boost.org">http://www.boost.org</ulink></bibliomisc>
|
||||
<para>&Boost.Thread; is one of many Boost libraries. The Boost web
|
||||
site includes a great deal of documentation and general information which
|
||||
applies to all Boost libraries. Current copies of the libraries including
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace boost
|
||||
|
||||
void operator()(void* data)
|
||||
{
|
||||
cleanup_function(static_cast<T*>(data));
|
||||
cleanup_function(data);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace boost
|
||||
|
||||
void operator()(void* data)
|
||||
{
|
||||
cleanup_function(static_cast<T*>(data));
|
||||
cleanup_function(data);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <boost/thread/detail/config.hpp>
|
||||
|
||||
#if defined(BOOST_HAS_WINTHREADS) && (defined(BOOST_THREAD_BUILD_LIB) || defined(BOOST_THREAD_TEST)) && (!defined(_MSC_VER) || defined(UNDER_CE))
|
||||
#if defined(BOOST_HAS_WINTHREADS) && (defined(BOOST_THREAD_BUILD_LIB) || defined(BOOST_THREAD_TEST) || defined(UNDER_CE)) && (!defined(_MSC_VER) || defined(UNDER_CE))
|
||||
|
||||
/*
|
||||
This file is a "null" implementation of tss cleanup; it's
|
||||
|
||||
@@ -187,54 +187,12 @@ void test_tss()
|
||||
timed_test(&do_test_tss, 2);
|
||||
}
|
||||
|
||||
bool tss_cleanup_called=false;
|
||||
|
||||
struct Dummy
|
||||
{};
|
||||
|
||||
void tss_custom_cleanup(Dummy* d)
|
||||
{
|
||||
delete d;
|
||||
tss_cleanup_called=true;
|
||||
}
|
||||
|
||||
boost::thread_specific_ptr<Dummy> tss_with_cleanup(tss_custom_cleanup);
|
||||
|
||||
void tss_thread_with_custom_cleanup()
|
||||
{
|
||||
tss_with_cleanup.reset(new Dummy);
|
||||
}
|
||||
|
||||
void do_test_tss_with_custom_cleanup()
|
||||
{
|
||||
boost::thread t(tss_thread_with_custom_cleanup);
|
||||
try
|
||||
{
|
||||
t.join();
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
t.interrupt();
|
||||
t.join();
|
||||
throw;
|
||||
}
|
||||
|
||||
BOOST_CHECK(tss_cleanup_called);
|
||||
}
|
||||
|
||||
|
||||
void test_tss_with_custom_cleanup()
|
||||
{
|
||||
timed_test(&do_test_tss_with_custom_cleanup, 2);
|
||||
}
|
||||
|
||||
boost::unit_test_framework::test_suite* init_unit_test_suite(int, char*[])
|
||||
{
|
||||
boost::unit_test_framework::test_suite* test =
|
||||
BOOST_TEST_SUITE("Boost.Threads: tss test suite");
|
||||
|
||||
test->add(BOOST_TEST_CASE(test_tss));
|
||||
test->add(BOOST_TEST_CASE(test_tss_with_custom_cleanup));
|
||||
|
||||
return test;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user