(taskID, execID string)
| 139 | } |
| 140 | |
| 141 | func (m *taskManager) deleteProc(taskID, execID string) (*vmProc, error) { |
| 142 | m.mu.Lock() |
| 143 | defer m.mu.Unlock() |
| 144 | |
| 145 | _, ok := m.tasks[taskID] |
| 146 | if !ok { |
| 147 | return nil, fmt.Errorf("cannot delete exec %q from non-existent task %q", execID, taskID) |
| 148 | } |
| 149 | |
| 150 | proc, ok := m.tasks[taskID][execID] |
| 151 | if !ok { |
| 152 | return nil, fmt.Errorf("cannot delete non-existent exec %q from task %q", execID, taskID) |
| 153 | } |
| 154 | |
| 155 | delete(m.tasks[taskID], execID) |
| 156 | if len(m.tasks[taskID]) == 0 { |
| 157 | delete(m.tasks, taskID) |
| 158 | } |
| 159 | |
| 160 | return proc, nil |
| 161 | } |
| 162 | |
| 163 | func (m *taskManager) ShutdownIfEmpty() bool { |
| 164 | m.mu.Lock() |
no outgoing calls
no test coverage detected