]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/context/example/v1/jump.cpp
2 // Copyright Oliver Kowalke 2014.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
10 #include <boost/context/all.hpp>
12 boost::context::execution_context
* ctx1
= nullptr;
13 boost::context::execution_context
* ctx2
= nullptr;
14 boost::context::execution_context
* ctx
= nullptr;
16 void f1( int i
, void *) {
17 std::cout
<< "f1: entered" << std::endl
;
18 std::cout
<< "i == " << i
<< std::endl
;
20 std::cout
<< "f1: re-entered" << std::endl
;
25 std::cout
<< "f2: entered" << std::endl
;
27 std::cout
<< "f2: re-entered" << std::endl
;
33 boost::context::execution_context
ctx1_( f1
, 3);
35 boost::context::execution_context
ctx2_( f2
);
37 boost::context::execution_context
ctx_( boost::context::execution_context::current() );
42 std::cout
<< "main: done" << std::endl
;