Skip to content
Snippets Groups Projects
Commit 6ac496f2 authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

dthreads: add dt_set_destructor() function

parent 632f801b
No related branches found
No related tags found
No related merge requests found
......@@ -704,6 +704,23 @@ int dt_setaffinity(dthread_t *thread, unsigned* cpu_id, size_t cpu_count)
return KNOT_EOK;
}
/*!
* \brief Set thread destructor to be called before physical thread termination.
*
* \param thread Target thread instance
* \param destructor Destructor callback.
*/
int dt_set_desctructor(dthread_t *thread, runnable_t destructor)
{
if (thread == 0) {
return KNOT_EINVAL;
}
thread->destruct = destructor;
return KNOT_EOK;
}
int dt_repurpose(dthread_t *thread, runnable_t runnable, void *data)
{
// Check
......
......@@ -225,6 +225,14 @@ int dt_stop(dt_unit_t *unit);
*/
int dt_setaffinity(dthread_t *thread, unsigned* cpu_id, size_t cpu_count);
/*!
* \brief Set thread destructor to be called before physical thread termination.
*
* \param thread Target thread instance
* \param destructor Destructor callback.
*/
int dt_set_desctructor(dthread_t *thread, runnable_t destructor);
/*!
* \brief Set thread to execute another runnable.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment