[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [task #6935] Problems to be solved with the current socket/
From: |
Frédéric Bernon |
Subject: |
[lwip-devel] [task #6935] Problems to be solved with the current socket/netconn API |
Date: |
Mon, 04 Jun 2007 09:38:56 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 |
Follow-up Comment #14, task #6935 (project lwip):
To be able to continue this item and to integrate last patchs, I would like
to add a way to enable the alternative communication feature with
tcpip_thread (the global mutex).
The idea is to add a define in opt.h like:
/* EXPERIMENTAL, Don't use it if you're not a lwIP project member */
#ifndef LWIP_TCPIP_CORE_LOCKING
#define LWIP_TCPIP_CORE_LOCKING 0
#endif
#if LWIP_TCPIP_CORE_LOCKING
LOCK_TCPIP_CORE() sys_sem_signal(lock_tcpip_core)
UNLOCK_TCPIP_CORE() sys_sem_signal(lock_tcpip_core)
#else
LOCK_TCPIP_CORE()
UNLOCK_TCPIP_CORE()
#endif
lock_tcpip_core will be defined and initialize in tcpip.c, and macro will be
add to avoid to change the code... About tcpip_apimsg, we could add a new
function like tcpipip_apimsg_lock, and a define to select the first one or
the second one in api_lib:
#if LWIP_TCPIP_CORE_LOCKING
#define TCPIP_APIMSG(m) tcpip_apimsg(m)
#else
#define TCPIP_APIMSG(m) tcpipip_apimsg_lock(m)
#endif
Note that all the functions in api_lib.c would used TCPIP_APIMSG, except
"netconn_connect" which is the only "asynchrone" function (it's need several
"tcpip_thread main loop" to provide a result.
In api_msg, most of "sys_mbox_post(msg->conn->mbox, NULL);" would be replace
by a TCPIP_ACKNOWLEDGE_CONN(c).
#if LWIP_TCPIP_CORE_LOCKING
#define TCPIP_ACK_APIMSG(m)
#else
#define TCPIP_ACK_APIMSG(m) sys_mbox_post(m->conn->mbox, NULL)
#endif
The exception is one again the "connect" functions (do_connected, and err_tcp
during "conn->state == NETCONN_CONNECT").
Agree for you?
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/task/?6935>
_______________________________________________
Message posté via/par Savannah
http://savannah.nongnu.org/
- [lwip-devel] [task #6935] Problems to be solved with the current socket/netconn API, Frédéric Bernon, 2007/06/01
- [lwip-devel] [task #6935] Problems to be solved with the current socket/netconn API,
Frédéric Bernon <=
- [lwip-devel] [task #6935] Problems to be solved with the current socket/netconn API, Frédéric Bernon, 2007/06/04
- [lwip-devel] [task #6935] Problems to be solved with the current socket/netconn API, Kieran Mansley, 2007/06/04
- [lwip-devel] [task #6935] Problems to be solved with the current socket/netconn API, Frédéric Bernon, 2007/06/08
- [lwip-devel] [task #6935] Problems to be solved with the current socket/netconn API, Simon Goldschmidt, 2007/06/09
- [lwip-devel] [task #6935] Problems to be solved with the current socket/netconn API, Frédéric Bernon, 2007/06/11
- [lwip-devel] [task #6935] Problems to be solved with the current socket/netconn API, Simon Goldschmidt, 2007/06/11
- [lwip-devel] [task #6935] Problems to be solved with the current socket/netconn API, Frédéric Bernon, 2007/06/11