[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] sys_sem_wait macro
From: |
Mason |
Subject: |
[lwip-devel] sys_sem_wait macro |
Date: |
Mon, 13 Feb 2012 14:22:12 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:10.0) Gecko/20120129 Firefox/10.0 SeaMonkey/2.7 |
Hello,
sys_sem_wait is defined in sys.h
#define sys_sem_wait(sem) sys_arch_sem_wait(sem, 0)
There are a few places where sys_sem_wait could be used
in the 1.4.0 code:
src/api/api_msg.c:1336: sys_arch_sem_wait(&msg->conn->op_completed, 0);
src/api/sockets.c:1640: sys_arch_sem_wait(&sock->conn->op_completed, 0);
src/api/sockets.c:2050: sys_arch_sem_wait(&sock->conn->op_completed, 0);
src/api/tcpip.c:313: sys_arch_sem_wait(&apimsg->msg.conn->op_completed, 0);
(Maybe this was already changed in the trunk.)
Related question:
When sys_arch_sem_wait is called with a non-zero timeout
value, the return value must be the time spent waiting.
If timeout is 0, meaning "block as long as necessary",
it seems the caller doesn't care how long he was blocked.
Can we return 0, or perhaps -1, or -2 or any arbitrary value?
--
Regards.
- [lwip-devel] sys_sem_wait macro,
Mason <=