mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Cleanup server for GMC, by WaitGroup to destroy. (#2247). v4.0.206
This commit is contained in:
parent
73c1392748
commit
63da0dca92
18 changed files with 114 additions and 42 deletions
|
|
@ -189,5 +189,23 @@ private:
|
|||
static void* pfn(void* arg);
|
||||
};
|
||||
|
||||
// Like goroytine sync.WaitGroup.
|
||||
class SrsWaitGroup
|
||||
{
|
||||
private:
|
||||
int nn_;
|
||||
srs_cond_t done_;
|
||||
public:
|
||||
SrsWaitGroup();
|
||||
virtual ~SrsWaitGroup();
|
||||
public:
|
||||
// When start for n coroutines.
|
||||
void add(int n);
|
||||
// When coroutine is done.
|
||||
void done();
|
||||
// Wait for all corotine to be done.
|
||||
void wait();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue