diff options
author | Lothar May <lothar.imap@googlemail.com> | 2010-10-22 22:04:16 (GMT) |
---|---|---|
committer | Lothar May <lothar.imap@googlemail.com> | 2010-10-22 22:04:16 (GMT) |
commit | a3d5a8e958e9a0ace7f1b9f81062d7d04ccef6b9 (patch) | |
tree | e9650804b10510321d0aa461a82571a14a676be1 /src/boost-test.cpp | |
parent | c988d7fac7a0d85e8af245bc89333ee73b369011 (diff) | |
download | mxe-a3d5a8e958e9a0ace7f1b9f81062d7d04ccef6b9.zip mxe-a3d5a8e958e9a0ace7f1b9f81062d7d04ccef6b9.tar.gz mxe-a3d5a8e958e9a0ace7f1b9f81062d7d04ccef6b9.tar.bz2 |
improved test program and portability patches for package boost
Diffstat (limited to 'src/boost-test.cpp')
-rw-r--r-- | src/boost-test.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/boost-test.cpp b/src/boost-test.cpp index ea809fe..baccf94 100644 --- a/src/boost-test.cpp +++ b/src/boost-test.cpp @@ -3,6 +3,18 @@ #include <iostream> #include <boost/archive/xml_oarchive.hpp> +#include <boost/thread/thread.hpp> +#include <boost/thread/tss.hpp> + +boost::thread_specific_ptr<int> ptr; + +void test_thread() +{ + if (ptr.get() == 0) { + ptr.reset(new int(0)); + } + std::cout << "Hello, World! from thread" << std::endl; +} int main(int argc, char *argv[]) { @@ -13,5 +25,8 @@ int main(int argc, char *argv[]) std::string s = "\n\n Hello, World!\n\n"; oa << BOOST_SERIALIZATION_NVP(s); + boost::thread thrd(test_thread); + thrd.join(); + return 0; } |