]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/thread/tutorial/tss.cpp
1 // Copyright (C) 2001-2003
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 #include <boost/thread/thread.hpp>
8 #include <boost/thread/tss.hpp>
11 boost::thread_specific_ptr
<int> value
;
21 value
.reset(new int(0)); // initialize the thread's storage
22 for (int i
=0; i
<10; ++i
)
30 int main(int argc
, char* argv
[])
32 boost::thread_group threads
;
33 for (int i
=0; i
<5; ++i
)
34 threads
.create_thread(&thread_proc
);