Skip to content

Commit

Permalink
Merge pull request #55 from COVESA/capicxx-core-runtime_3.2.4
Browse files Browse the repository at this point in the history
capicxx-core-runtime 3.2.4
  • Loading branch information
fcmonteiro authored Oct 8, 2024
2 parents c4351ee + 9eb5d39 commit 0e1d97e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cc_defaults {
rtti: true,

cppflags: [
"-std=c++11",
"-std=c++17",
"-Wall",
"-Wextra",
"-Wformat",
Expand Down
7 changes: 7 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changes
=======

v3.2.4
- Added github workflow to build the project in Ubuntu and Windows

v3.2.3-r8
- Fix Copyright & github link in README
- (dev) Warn about multiple subscriptions

v3.2.3-r7
- Fixed warnings with gcc11 for Wextra-extra-semi flag
- Fix capi-core-runtime Runtime::loadLibrary
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PROJECT(libcommonapi)
# version of CommonAPI
SET( LIBCOMMONAPI_MAJOR_VERSION 3 )
SET( LIBCOMMONAPI_MINOR_VERSION 2 )
SET( LIBCOMMONAPI_PATCH_VERSION 3 )
SET( LIBCOMMONAPI_PATCH_VERSION 4 )

message(STATUS "Project name: ${PROJECT_NAME}")

Expand Down Expand Up @@ -106,7 +106,7 @@ IF(MSVC)
add_definitions(-DCOMMONAPI_INTERNAL_COMPILATION -DCOMMONAPI_DLL_COMPILATION)
add_compile_options(/EHsc /wd4996)
ELSE ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Werror=extra-semi -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector-strong -fasynchronous-unwind-tables -fno-omit-frame-pointer -Werror -DCOMMONAPI_INTERNAL_COMPILATION -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -Wextra -Werror=extra-semi -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector-strong -fasynchronous-unwind-tables -fno-omit-frame-pointer -Werror -DCOMMONAPI_INTERNAL_COMPILATION -fvisibility=hidden")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wformat-security -fstack-protector-strong")
ENDIF(MSVC)

Expand Down
12 changes: 11 additions & 1 deletion include/CommonAPI/Event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ class Event {
(void)_listener;
}

/**
* \brief Get the number of subscriptions to this event.
*
* \warning This method acquires a lock on `subscriptionMutex_`.
*/
std::size_t getSubscriptionCount() const {
std::lock_guard<std::mutex> itsSubscriptionLock(subscriptionMutex_);
return subscriptions_.size();
}

private:
ListenersMap subscriptions_;
Subscription nextSubscription_;
Expand All @@ -98,7 +108,7 @@ class Event {
SubscriptionsSet pendingUnsubscriptions_;

std::mutex notificationMutex_;
std::mutex subscriptionMutex_;
mutable std::mutex subscriptionMutex_;
};

template<typename ... Arguments_>
Expand Down

0 comments on commit 0e1d97e

Please sign in to comment.