Skip to content

Commit 0e1d97e

Browse files
authored
Merge pull request #55 from COVESA/capicxx-core-runtime_3.2.4
capicxx-core-runtime 3.2.4
2 parents c4351ee + 9eb5d39 commit 0e1d97e

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

Android.bp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cc_defaults {
44
rtti: true,
55

66
cppflags: [
7-
"-std=c++11",
7+
"-std=c++17",
88
"-Wall",
99
"-Wextra",
1010
"-Wformat",

CHANGES

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changes
22
=======
33

4+
v3.2.4
5+
- Added github workflow to build the project in Ubuntu and Windows
6+
7+
v3.2.3-r8
8+
- Fix Copyright & github link in README
9+
- (dev) Warn about multiple subscriptions
10+
411
v3.2.3-r7
512
- Fixed warnings with gcc11 for Wextra-extra-semi flag
613
- Fix capi-core-runtime Runtime::loadLibrary

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ PROJECT(libcommonapi)
1010
# version of CommonAPI
1111
SET( LIBCOMMONAPI_MAJOR_VERSION 3 )
1212
SET( LIBCOMMONAPI_MINOR_VERSION 2 )
13-
SET( LIBCOMMONAPI_PATCH_VERSION 3 )
13+
SET( LIBCOMMONAPI_PATCH_VERSION 4 )
1414

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

@@ -106,7 +106,7 @@ IF(MSVC)
106106
add_definitions(-DCOMMONAPI_INTERNAL_COMPILATION -DCOMMONAPI_DLL_COMPILATION)
107107
add_compile_options(/EHsc /wd4996)
108108
ELSE ()
109-
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")
109+
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")
110110
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wformat-security -fstack-protector-strong")
111111
ENDIF(MSVC)
112112

include/CommonAPI/Event.hpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ class Event {
9090
(void)_listener;
9191
}
9292

93+
/**
94+
* \brief Get the number of subscriptions to this event.
95+
*
96+
* \warning This method acquires a lock on `subscriptionMutex_`.
97+
*/
98+
std::size_t getSubscriptionCount() const {
99+
std::lock_guard<std::mutex> itsSubscriptionLock(subscriptionMutex_);
100+
return subscriptions_.size();
101+
}
102+
93103
private:
94104
ListenersMap subscriptions_;
95105
Subscription nextSubscription_;
@@ -98,7 +108,7 @@ class Event {
98108
SubscriptionsSet pendingUnsubscriptions_;
99109

100110
std::mutex notificationMutex_;
101-
std::mutex subscriptionMutex_;
111+
mutable std::mutex subscriptionMutex_;
102112
};
103113

104114
template<typename ... Arguments_>

0 commit comments

Comments
 (0)