File tree Expand file tree Collapse file tree 1 file changed +0
-13
lines changed Expand file tree Collapse file tree 1 file changed +0
-13
lines changed Original file line number Diff line number Diff line change 9
9
#include < boost/mysql/pool_params.hpp>
10
10
11
11
#include < boost/asio/bind_executor.hpp>
12
- #include < boost/asio/cancel_after.hpp>
13
12
#include < boost/asio/detached.hpp>
14
13
#include < boost/asio/post.hpp>
15
14
#include < boost/asio/thread_pool.hpp>
16
15
17
- #include < chrono>
18
16
#include < memory>
19
17
20
18
#include " tsan_pool_common.hpp"
@@ -31,7 +29,6 @@ void run(const char* hostname)
31
29
// Setup
32
30
asio::thread_pool ctx (8 );
33
31
34
- // Using cancel()
35
32
for (int i = 0 ; i < 20 ; ++i)
36
33
{
37
34
// Create a pool
@@ -44,16 +41,6 @@ void run(const char* hostname)
44
41
asio::post (asio::bind_executor (ctx.get_executor (), [pool]() { pool->cancel (); }));
45
42
}
46
43
47
- // Using per-operation cancellation
48
- for (int i = 0 ; i < 20 ; ++i)
49
- {
50
- // Create a pool
51
- mysql::connection_pool pool (ctx, create_pool_params (hostname, 10 ));
52
-
53
- // Run the pool for a short period of time
54
- pool.async_run (asio::cancel_after (std::chrono::milliseconds (1 ), asio::detached));
55
- }
56
-
57
44
// Run
58
45
ctx.join ();
59
46
}
You can’t perform that action at this time.
0 commit comments