Closed lebdron closed 5 years ago
rxcpp::composite_subscription lifetime; rxcpp::subjects::synchronize<int, rxcpp::identity_one_worker> sub( rxcpp::identity_current_thread(), lifetime); sub.get_subscriber().on_next(1); lifetime.unsubscribe();
This code locks in drain_queue https://github.com/ReactiveX/RxCpp/blob/7c79c18ab252eb37bcf122c75070f8d557868c08/Rx/v2/src/rxcpp/subjects/rx-synchronize.hpp#L60 because the lock in on_next is not unlocked https://github.com/ReactiveX/RxCpp/blob/7c79c18ab252eb37bcf122c75070f8d557868c08/Rx/v2/src/rxcpp/subjects/rx-synchronize.hpp#L107
drain_queue
on_next
Should it be safe to call unlock before these lines? https://github.com/ReactiveX/RxCpp/blob/7c79c18ab252eb37bcf122c75070f8d557868c08/Rx/v2/src/rxcpp/subjects/rx-synchronize.hpp#L91-L92 schedule should be thread-safe by contract if I am not mistaken.
unlock
schedule
Yes, I believe that it would be safe to unlock before the call to schedule.
This code locks in
drain_queue
https://github.com/ReactiveX/RxCpp/blob/7c79c18ab252eb37bcf122c75070f8d557868c08/Rx/v2/src/rxcpp/subjects/rx-synchronize.hpp#L60 because the lock inon_next
is not unlocked https://github.com/ReactiveX/RxCpp/blob/7c79c18ab252eb37bcf122c75070f8d557868c08/Rx/v2/src/rxcpp/subjects/rx-synchronize.hpp#L107Should it be safe to call
unlock
before these lines? https://github.com/ReactiveX/RxCpp/blob/7c79c18ab252eb37bcf122c75070f8d557868c08/Rx/v2/src/rxcpp/subjects/rx-synchronize.hpp#L91-L92schedule
should be thread-safe by contract if I am not mistaken.