You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by GitBox <gi...@apache.org> on 2022/06/03 14:39:04 UTC

[GitHub] [celix] stegemr commented on a diff in pull request #418: Adding async source and remove asan issue in close of source

stegemr commented on code in PR #418:
URL: https://github.com/apache/celix/pull/418#discussion_r889007802


##########
libs/pushstreams/api/celix/impl/AbstractPushEventSource.h:
##########
@@ -102,15 +102,15 @@ void celix::AbstractPushEventSource<T>::open(std::shared_ptr<celix::IPushEventCo
 
 template <typename T>
 [[nodiscard]] celix::Promise<void> celix::AbstractPushEventSource<T>::connectPromise() {
-    std::lock_guard lck{mutex};
+    std::unique_lock lck{mutex};

Review Comment:
   done



##########
libs/pushstreams/api/celix/AsynchronousPushEventSource.h:
##########
@@ -51,19 +57,14 @@ namespace celix {
 *********************************************************************************/
 
 template <typename T>
-celix::SimplePushEventSource<T>::SimplePushEventSource(PromiseFactory& promiseFactory): AbstractPushEventSource<T>{promiseFactory},
-    executor{promiseFactory.getExecutor()} {
+celix::AsynchronousPushEventSource<T>::AsynchronousPushEventSource(std::shared_ptr<PromiseFactory>& promiseFactory): AbstractPushEventSource<T>{promiseFactory},
+                                                                                                    executor{promiseFactory->getExecutor()} {
 
-//    executor->execute([]() {
-//        for(;;) {
-//
-//        }
-//    });
 }
 
 template <typename T>
-void celix::SimplePushEventSource<T>::execute(std::function<void()> task) {
-    task();
+void celix::AsynchronousPushEventSource<T>::execute(std::function<void()> task) {
+    executor->execute(task);

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org