Skip to content

Commit

Permalink
Refine comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Sep 9, 2024
1 parent 79161b9 commit 2e7f2c2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions trunk/src/app/srs_app_st.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@ SrsWaitGroup::SrsWaitGroup()

SrsWaitGroup::~SrsWaitGroup()
{
// In the destructor, we should NOT wait for all coroutines to be done, because user should decide
// to wait or not. Similar to the Go's sync.WaitGroup, it also requires user to wait explicitly. For
// some special use scenarios, such as error handling, for example, if we started three servers with
// wait group, and one of them failed, user may want to return error and quit directly, without wait
// for other running servers to be done. If we wait in the destructor, it will continue to run without
// some servers, in unknown behaviors.
srs_cond_destroy(done_);
}

Expand Down

0 comments on commit 2e7f2c2

Please sign in to comment.