kernel: Add interrupt function to C header

Calling interrupt can halt long-running functions associated with
objects that were created through the passed-in context.
This commit is contained in:
TheCharlatan
2024-06-05 10:20:40 +02:00
parent 1976b13be9
commit d27e27758d
4 changed files with 22 additions and 0 deletions

View File

@@ -676,6 +676,11 @@ btck_Context* btck_context_copy(const btck_Context* context)
return btck_Context::copy(context);
}
int btck_context_interrupt(btck_Context* context)
{
return (*btck_Context::get(context)->m_interrupt)() ? 0 : -1;
}
void btck_context_destroy(btck_Context* context)
{
delete context;