kern: unify all waiting semantics to use single api

This commit is contained in:
Michael Scire authored and SciresM committed 2021-09-19 10:34:31 -07:00
1 parent f6fb5f2c8d
commit 90732ff311
22 files changed
+904 -683

No files matched your search

@@ -229,11 +229,14 @@ namespace ams::kern::svc {
/* Send the request. */
MESOSPHERE_ASSERT(message != 0);
R_TRY(SendAsyncRequestWithUserBufferImpl(out_event_handle, message, buffer_size, session_handle));
const Result result = SendAsyncRequestWithUserBufferImpl(out_event_handle, message, buffer_size, session_handle);
/* We sent the request successfully. */
unlock_guard.Cancel();
return ResultSuccess();
/* If the request succeeds (or the thread is terminating), don't unlock the user buffer. */
if (R_SUCCEEDED(result) || svc::ResultTerminationRequested::Includes(result)) {
unlock_guard.Cancel();
}
return result;
}
ALWAYS_INLINE Result ReplyAndReceive(int32_t *out_index, KUserPointer<const ams::svc::Handle *> handles, int32_t num_handles, ams::svc::Handle reply_target, int64_t timeout_ns) {