mirror of
https://github.com/bluenviron/mediamtx
synced 2024-12-12 18:00:12 +00:00
21 lines
283 B
Go
21 lines
283 B
Go
|
package externalcmd
|
||
|
|
||
|
import (
|
||
|
"sync"
|
||
|
)
|
||
|
|
||
|
// Pool is a pool of external commands.
|
||
|
type Pool struct {
|
||
|
wg sync.WaitGroup
|
||
|
}
|
||
|
|
||
|
// NewPool allocates a Pool.
|
||
|
func NewPool() *Pool {
|
||
|
return &Pool{}
|
||
|
}
|
||
|
|
||
|
// Close waits for all external commands to exit.
|
||
|
func (p *Pool) Close() {
|
||
|
p.wg.Wait()
|
||
|
}
|