Skip to content

Commit 0be6f83

Browse files
committed
PR feedback and fix build break
1 parent 2f093fc commit 0be6f83

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/windows/wslc/core/AsyncExecution.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace detail {
3737
{
3838
}
3939

40-
TItem item;
40+
std::optional<TItem> item;
4141
std::optional<TResult> result;
4242
wil::ResultException error{S_OK};
4343
bool hasError{false};
@@ -142,7 +142,7 @@ namespace detail {
142142

143143
if (worker->workerResult.hasError)
144144
{
145-
onError(worker->workerResult.item, worker->workerResult.error);
145+
onError(*worker->workerResult.item, worker->workerResult.error);
146146
}
147147
else if (worker->workerResult.result.has_value())
148148
{
@@ -180,7 +180,7 @@ namespace detail {
180180

181181
try
182182
{
183-
worker.workerResult.result = worker.context->onWork(worker.workerResult.item, worker.context->cancelEvent.get());
183+
worker.workerResult.result = worker.context->onWork(*worker.workerResult.item, worker.context->cancelEvent.get());
184184
}
185185
catch (const wil::ResultException& ex)
186186
{
@@ -190,7 +190,7 @@ namespace detail {
190190
catch (...)
191191
{
192192
worker.workerResult.hasError = true;
193-
worker.workerResult.error = wil::ResultException{wil::details::ResultFromCaughtException()};
193+
worker.workerResult.error = wil::ResultException{wil::ResultFromCaughtException()};
194194
}
195195

196196
worker.done.SetEvent();

src/windows/wslc/tasks/ContainerTasks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ void ShowContainerStats(CLIExecutionContext& context)
575575
// Work to be done for each container ID on a separate thread.
576576
// cancelHandle is signalled if the overall operation times out, check it before
577577
// the blocking Stats call so we exit cooperatively without waiting a full ~1s sample.
578-
[session, userSpecifiedContainers](const std::wstring& containerId, HANDLE cancelHandle) {
578+
[session, userSpecifiedContainers](const std::wstring& containerId, HANDLE cancelHandle) mutable {
579579
if (::WaitForSingleObject(cancelHandle, 0) == WAIT_OBJECT_0)
580580
{
581581
THROW_HR(HRESULT_FROM_WIN32(ERROR_CANCELLED));

0 commit comments

Comments
 (0)