[En-Nut-Discussion] Possible race condition in DHCP and DHCPKick
Harald Kipp
harald.kipp at egnite.de
Wed May 8 15:03:22 CEST 2013
On 11.02.2012 17:20, Ole Reinhardt wrote:
> But shouldn't we change the other places as well:
>
> multiple times in NutDhcpClient()
>
> ...
> NutEventBroadcast(&dhcpDone);
> NutEventWait(&dhcpWake, NUT_WAIT_INFINITE);
> ...
>
> To
>
> ... mutiple time:
> NutEventBroadcastAsync(&dhcpDone);
> NutEventWait(&dhcpWake, NUT_WAIT_INFINITE);
> ...
No, this is not required. dhcpWake is posted with NutEventPost(Async),
empty queues are signaled. So NutEventWait will return immediately.
The problem that Henrik reported appears only, because the DHCP thread
uses NutEventBroadcast, which will not signal an empty queue.
Regards,
Harald
More information about the En-Nut-Discussion
mailing list