Skip to content

Commit 2ef98b2

Browse files
committed
RU: fix RU dummy race condition
1 parent 03e7756 commit 2ef98b2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/ru/dummy/ru_dummy_sector.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,14 @@ class ru_dummy_sector : public ru_uplink_plane_handler, public ru_downlink_plane
285285
current_resource = std::move(resource);
286286
}
287287

288-
// Transition to available.
288+
// Move token to stack before transitioning to a different state.
289+
stop_event_token local_token = std::move(token);
290+
291+
// Transition to available. The object will become available again.
289292
internal_state.store(internal_states::available);
290293

291-
// Signal that this request object is available again.
292-
token.reset();
294+
// Reset the stop token.
295+
local_token.reset();
293296

294297
// Return the context and resource.
295298
return {current_context, std::move(current_resource)};

0 commit comments

Comments
 (0)