diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-02-09 07:50:10 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-02-09 07:50:10 -0600 |
commit | e1f5738a8df9845a03ffc086f70ec3ecd52300f0 (patch) | |
tree | 25efdca7ed41496d7ffcd42793053e29651a6540 /nuttx/include | |
parent | 933eaea87490cfd0a5a353ac3373c9c126222713 (diff) | |
download | px4-nuttx-e1f5738a8df9845a03ffc086f70ec3ecd52300f0.tar.gz px4-nuttx-e1f5738a8df9845a03ffc086f70ec3ecd52300f0.tar.bz2 px4-nuttx-e1f5738a8df9845a03ffc086f70ec3ecd52300f0.zip |
Networking: Clean up and consolidate some clunky stuff by adding new net_timedwait() function
Diffstat (limited to 'nuttx/include')
-rw-r--r-- | nuttx/include/nuttx/net/net.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/nuttx/include/nuttx/net/net.h b/nuttx/include/nuttx/net/net.h index 2e3206de0..4b35f35d5 100644 --- a/nuttx/include/nuttx/net/net.h +++ b/nuttx/include/nuttx/net/net.h @@ -222,10 +222,35 @@ void net_unlock(net_lock_t flags); #endif /**************************************************************************** + * Function: net_timedwait + * + * Description: + * Atomically wait for sem (or a timeout( while temporarily releasing + * the lock on the network. + * + * Input Parameters: + * sem - A reference to the semaphore to be taken. + * abstime - The absolute time to wait until a timeout is declared. + * + * Returned value: + * The returned value is the same as sem_timedwait(): Zero (OK) is + * returned on success; -1 (ERROR) is returned on a failure with the + * errno value set appropriately. + * + ****************************************************************************/ + +#ifdef CONFIG_NET_NOINTS +struct timespec; +int net_timedwait(sem_t *sem, FAR const struct timespec *abstime); +#else +# define net_timedwait(s,t) sem_timedwait(s,t) +#endif + +/**************************************************************************** * Function: net_lockedwait * * Description: - * Atomically wait for sem while temporarily releasing g_netlock. + * Atomically wait for sem while temporarily releasing lock on the network. * * Input Parameters: * sem - A reference to the semaphore to be taken. |