lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #19347] netif_add & tcpip_init problem


From: Frédéric Bernon
Subject: [lwip-devel] [bug #19347] netif_add & tcpip_init problem
Date: Tue, 03 Apr 2007 09:09:32 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

Follow-up Comment #20, bug #19347 (project lwip):

Yes, "global" semaphore is a good idea, but in this case, we can't propose a
nice "integrated" netifapi for callers :

//draft
err_t
netifapi_dhcp_stop( netif* mynetif)
  struct netifapi_msg msg;
  msg.type = NETIFAPI_MSG_DHCP_STOP;
  msg.netif = my_netif;
  msg.sem   = netifapi_sem;
  if (tcpip_netifapi(&msg)!=ERR_OK) {
  /* error handler */
  } 
}

Here, netifapi_sem is not defined. It can be done inside netifapi_dhcp_stop
(and I think we can, because the part of the api don't have to got a high
performance: we don't start/stop shcp or add/remove netif each n
milliseconds, isn't it? So, a integrate semaphore is a "nice" solution.
Another one is to define global semaphores and to add a netifapi_init() to
initialize them. But It can cause others multithread problem (two interfaces
add in the same time by example).

Your opinion about that?

>since the code has to run inside the context of a thread in tcpip.c

Yes, but it's the same for api_msg, but in a extra file.




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?19347>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]