Skip to content

Commit

Permalink
avoid join called from its own thread
Browse files Browse the repository at this point in the history
  • Loading branch information
huangminghuang committed Mar 1, 2023
1 parent 76816a8 commit e7a1572
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/libfc/src/log/gelf_appender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ namespace fc
return;

// use now() instead of context.get_timestamp() because log_message construction can include user provided long running calls
boost::asio::post(my->io_context, [impl = my, time_ns = time_point::now().time_since_epoch().count(), message] () {
boost::asio::post(my->io_context, [impl = my.get(), time_ns = time_point::now().time_since_epoch().count(), message] () {
try {
do_log(impl.get(), time_ns, message);
do_log(impl, time_ns, message);
} catch (std::exception& ex) {
fprintf(stderr, "GELF logger caught exception at %s:%d : %s\n", __FILE__, __LINE__, ex.what());
} catch (...) {
Expand Down

0 comments on commit e7a1572

Please sign in to comment.