[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] Semaphore assertion in tcpip_init_done
From: |
Kieran Mansley |
Subject: |
[lwip-devel] Semaphore assertion in tcpip_init_done |
Date: |
Wed, 17 Feb 2010 15:31:53 +0000 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
I think there might be a problem with the way some of the unix port apps
are using semaphores or tcpip_init() after the recent changes to the
sys_sem API.
The apps do things like this:
sys_sem_t sem;
netif_init();
if(sys_sem_new(&sem, 0) != ERR_OK) {
LWIP_ASSERT("Failed to create semaphore", 0);
}
tcpip_init(tcpip_init_done, &sem);
sys_sem_wait(&sem);
But when run they are hitting an assertion in their tcpip_init_done
function where it tries to signal the semaphore. That function is doing
this:
tcpip_init_done(void *arg)
{
sys_sem_t *sem;
sem = arg;
init_netifs();
sys_sem_signal(*sem);
}
sys_sem_signal (again in the unix port) has the assertion:
sys_sem_signal(struct sys_sem **s)
{
struct sys_sem *sem;
LWIP_ASSERT("invalid sem", (s != NULL) && (*s != NULL));
As you can see, sys_sem_signal takes a "struct sys_sem **" but it is
being called with a "sys_sem_t". I'm not sure after the recent changes
which of these bits is in error. I wonder if anyone can help me work
out which is wrong? I'm happy to update the port as necessary.
Thanks
Kieran
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-devel] Semaphore assertion in tcpip_init_done,
Kieran Mansley <=