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

Is this a bug of PlayTaskProducer? #15380

Open
Wuqiqi123 opened this issue Apr 18, 2024 · 0 comments
Open

Is this a bug of PlayTaskProducer? #15380

Wuqiqi123 opened this issue Apr 18, 2024 · 0 comments

Comments

@Wuqiqi123
Copy link

Wuqiqi123 commented Apr 18, 2024

Just like the code in PlayTaskProducer::Stop, if the is_stopped_ is false(running), stop function will just return directly.

void PlayTaskProducer::Stop() {
if (!is_stopped_.exchange(true)) {
return;
}
if (produce_th_ != nullptr && produce_th_->joinable()) {
produce_th_->join();
produce_th_ = nullptr;
}
}

Is this changes right?

-   if (!is_stopped_.exchange(true)) { 
+   if (is_stopped_.exchange(true)) { 
     return; 
   } 

Also the PlayTaskConsume::Stop looks right here.

void PlayTaskConsumer::Stop() {
if (is_stopped_.exchange(true)) {
return;
}
if (consume_th_ != nullptr && consume_th_->joinable()) {
consume_th_->join();
consume_th_ = nullptr;
}
// reset value for next use consumer
base_msg_play_time_ns_ = 0;
base_msg_real_time_ns_ = 0;
last_played_msg_real_time_ns_ = 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant