File tree Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Original file line number Diff line number Diff 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" ,
Original file line number Diff line number Diff line change 11Changes
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+
411v3.2.3-r7
512- Fixed warnings with gcc11 for Wextra-extra-semi flag
613- Fix capi-core-runtime Runtime::loadLibrary
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ PROJECT(libcommonapi)
1010# version of CommonAPI
1111SET ( LIBCOMMONAPI_MAJOR_VERSION 3 )
1212SET ( LIBCOMMONAPI_MINOR_VERSION 2 )
13- SET ( LIBCOMMONAPI_PATCH_VERSION 3 )
13+ SET ( LIBCOMMONAPI_PATCH_VERSION 4 )
1414
1515message (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)
108108ELSE ()
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" )
111111ENDIF (MSVC )
112112
Original file line number Diff line number Diff 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+
93103private:
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
104114template <typename ... Arguments_>
You can’t perform that action at this time.
0 commit comments