mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refine comments.
This commit is contained in:
parent
79161b91f0
commit
2e7f2c2d78
1 changed files with 6 additions and 0 deletions
|
@ -342,6 +342,12 @@ SrsWaitGroup::SrsWaitGroup()
|
||||||
|
|
||||||
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_);
|
srs_cond_destroy(done_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue