mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-11 00:17:41 +00:00
libpod: unlock the thread if possible
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
9ffac33178
commit
094bc673ef
1 changed files with 7 additions and 2 deletions
|
|
@ -45,8 +45,13 @@ func (r *ConmonOCIRuntime) createRootlessContainer(ctr *Container, restoreOption
|
|||
return 0, err
|
||||
}
|
||||
defer func() {
|
||||
if err := unix.Setns(int(fd.Fd()), unix.CLONE_NEWNS); err != nil {
|
||||
logrus.Errorf("Unable to clone new namespace: %q", err)
|
||||
err := unix.Setns(int(fd.Fd()), unix.CLONE_NEWNS)
|
||||
if err == nil {
|
||||
// If we are able to reset the previous mount namespace, unlock the thread and reuse it
|
||||
runtime.UnlockOSThread()
|
||||
} else {
|
||||
// otherwise, leave the thread locked and the Go runtime will terminate it
|
||||
logrus.Errorf("Unable to reset the previous mount namespace: %q", err)
|
||||
}
|
||||
}()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue