Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capicxx-core-runtime 3.2.4 #55

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading