diff --git a/src/backward.h b/src/backward.h index 940116e..c924a70 100644 --- a/src/backward.h +++ b/src/backward.h @@ -3057,7 +3057,7 @@ class TraceResolverDarwinImpl : public Tra if (st.size() == 0) { return; } - _symbols.reset(backtrace_symbols(st.begin(), st.size())); + _symbols.reset(backtrace_symbols(st.begin(), (int) st.size())); } ResolvedTrace resolve(ResolvedTrace trace) diff --git a/src/runtime.cpp b/src/runtime.cpp index 2c12542..53aa2fb 100644 --- a/src/runtime.cpp +++ b/src/runtime.cpp @@ -19,6 +19,7 @@ #include "aws/logging/logging.h" #include "aws/http/response.h" +#include #include #include #include // for ULONG_MAX @@ -27,6 +28,7 @@ #include #include // for strtoul #include +#include #define AWS_LAMBDA_RUNTIME_API __attribute__((visibility("default"))) @@ -395,9 +397,23 @@ static bool handle_post_outcome(runtime::post_outcome const& o, std::string cons return false; } +void listen_messages(std::function const& handler) { + logging::log_info(LOG_TAG, "Executing thread"); + std::this_thread::sleep_for(std::chrono::milliseconds (20000)); + run_handler(handler); +} + +void start_listener(std::function const& handler) { + logging::log_info(LOG_TAG, "Starting listener"); + std::thread t1(listen_messages, handler); + t1.detach(); +} + AWS_LAMBDA_RUNTIME_API void run_handler(std::function const& handler) { + start_listener(handler); + logging::log_info(LOG_TAG, "Initializing the C++ Lambda Runtime version %s", aws::lambda_runtime::get_version()); std::string endpoint("http://"); if (auto ep = std::getenv("AWS_LAMBDA_RUNTIME_API")) {