From 4bb9cbe64d962f3ba5804599a0b93185514c88c8 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Fri, 9 Apr 2021 16:34:27 +0200 Subject: [PATCH] iox-#615 extend C API with the runtime shutdown method Signed-off-by: Mathias Kraus --- iceoryx_binding_c/include/iceoryx_binding_c/runtime.h | 5 +++++ iceoryx_binding_c/source/c_runtime.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/iceoryx_binding_c/include/iceoryx_binding_c/runtime.h b/iceoryx_binding_c/include/iceoryx_binding_c/runtime.h index 09080fb4c1..a1450de46e 100644 --- a/iceoryx_binding_c/include/iceoryx_binding_c/runtime.h +++ b/iceoryx_binding_c/include/iceoryx_binding_c/runtime.h @@ -1,4 +1,5 @@ // Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -32,4 +33,8 @@ void iox_runtime_init(const char* const name); /// If name is a nullptr, 0 will be returned. uint64_t iox_runtime_get_instance_name(char* const name, const uint64_t nameLength); +/// @brief initiates the shutdown of the runtime to unblock all potentially blocking publisher +/// with the iox_SubscriberTooSlowPolicy::SubscriberTooSlowPolicy_WAIT_FOR_SUBSCRIBER option set +void iox_runtime_shutdown(); + #endif diff --git a/iceoryx_binding_c/source/c_runtime.cpp b/iceoryx_binding_c/source/c_runtime.cpp index ea30f7cfd0..5120c14c0b 100644 --- a/iceoryx_binding_c/source/c_runtime.cpp +++ b/iceoryx_binding_c/source/c_runtime.cpp @@ -53,3 +53,8 @@ uint64_t iox_runtime_get_instance_name(char* const name, const uint64_t nameLeng return instanceName.size(); } + +void iox_runtime_shutdown() +{ + PoshRuntime::getInstance().shutdown(); +}