Skip to content

Commit

Permalink
add size parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Aug 26, 2023
1 parent 8a18d1a commit e161402
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions include/ylt/coro_io/io_context_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,15 @@ inline T &g_block_io_context_pool(
}

template <typename T = io_context_pool>
inline auto get_global_executor() {
return g_io_context_pool<T>().get_executor();
inline auto get_global_executor(
unsigned pool_size = std::thread::hardware_concurrency()) {
return g_io_context_pool<T>(pool_size).get_executor();
}

template <typename T = io_context_pool>
inline auto get_global_block_executor() {
return g_block_io_context_pool<T>().get_executor();
inline auto get_global_block_executor(
unsigned pool_size = std::thread::hardware_concurrency()) {
return g_block_io_context_pool<T>(pool_size).get_executor();
}

} // namespace coro_io

0 comments on commit e161402

Please sign in to comment.