Commit 245104ca authored by Philippe Gerum's avatar Philippe Gerum

net/stack: restore original deletion sequence for service tasks

Restore the original sequence for deleting an internal service task
that should most likely be waiting for an input event: first destroy
the event resourcen, which should trigger immediate return from the
wait call with -EIDRM, then send a cancellation request via
rtdm_task_destroy() for good measure to exit the work loop if the task
was not aslept on that event.

This obviously assumes that all callers waiting for events do check
for the return value, as they must do.
parent 8bf68ea3
......@@ -420,8 +420,8 @@ static void __exit rtnetproxy_cleanup_module(void)
unregister_netdev(dev_rtnetproxy);
free_netdev(dev_rtnetproxy);
rtdm_task_destroy(&rtnetproxy_tx_task);
rtdm_event_destroy(&rtnetproxy_tx_event);
rtdm_task_destroy(&rtnetproxy_tx_task);
/* free the non-real-time signal */
rtdm_nrtsig_destroy(&rtnetproxy_rx_signal);
......
......@@ -567,8 +567,8 @@ int __init rtcfg_init_frames(void)
return 0;
error2:
rtdm_task_destroy(&rx_task);
rtdm_event_destroy(&rx_event);
rtdm_task_destroy(&rx_task);
error1:
rtskb_pool_release(&rtcfg_pool);
......@@ -585,8 +585,8 @@ void rtcfg_cleanup_frames(void)
rtdev_remove_pack(&rtcfg_packet_type);
rtdm_task_destroy(&rx_task);
rtdm_event_destroy(&rx_event);
rtdm_task_destroy(&rx_task);
while ((rtskb = rtskb_dequeue(&rx_queue)) != NULL) {
kfree_rtskb(rtskb);
......
......@@ -138,6 +138,6 @@ int __init nomac_proto_init(void)
void nomac_proto_cleanup(void)
{
rtdm_task_destroy(&wrapper_task);
rtdm_event_destroy(&wakeup_sem);
rtdm_task_destroy(&wrapper_task);
}
......@@ -270,8 +270,8 @@ int __init rtpc_init(void)
void rtpc_cleanup(void)
{
rtdm_task_destroy(&dispatch_task);
rtdm_event_destroy(&dispatch_event);
rtdm_task_destroy(&dispatch_task);
rtdm_nrtsig_destroy(&rtpc_nrt_signal);
}
......
......@@ -261,6 +261,6 @@ int rt_stack_mgr_init (struct rtnet_mgr *mgr)
*/
void rt_stack_mgr_delete (struct rtnet_mgr *mgr)
{
rtdm_task_destroy(&mgr->task);
rtdm_event_destroy(&mgr->event);
rtdm_task_destroy(&mgr->task);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment