mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Replace execdrivers with containerd implementation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com> Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> Signed-off-by: Anusha Ragunathan <anusha@docker.com>
This commit is contained in:
parent
cc83031ade
commit
9c4570a958
89 changed files with 5696 additions and 1252 deletions
29
libcontainerd/queue_linux.go
Normal file
29
libcontainerd/queue_linux.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package libcontainerd
|
||||
|
||||
import "sync"
|
||||
|
||||
type queue struct {
|
||||
sync.Mutex
|
||||
fns map[string]chan struct{}
|
||||
}
|
||||
|
||||
func (q *queue) append(id string, f func()) {
|
||||
q.Lock()
|
||||
defer q.Unlock()
|
||||
|
||||
if q.fns == nil {
|
||||
q.fns = make(map[string]chan struct{})
|
||||
}
|
||||
|
||||
done := make(chan struct{})
|
||||
|
||||
fn, ok := q.fns[id]
|
||||
q.fns[id] = done
|
||||
go func() {
|
||||
if ok {
|
||||
<-fn
|
||||
}
|
||||
f()
|
||||
close(done)
|
||||
}()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue