Merge pull request #133 from xiaoxiang781216/fix-netlink-notifier

wqueue/notifier: update the work notifier usage
This commit is contained in:
Alin Jerpelea 2020-01-21 08:58:54 +01:00 committed by GitHub
commit 6694a16eb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 38 deletions

View File

@ -143,7 +143,7 @@ void iob_notifier_signal(void)
{
/* This is just a simple wrapper around work_notifier_signal(). */
return work_notifier_signal(WORK_IOB_AVAIL, NULL);
work_notifier_signal(WORK_IOB_AVAIL, NULL);
}
#endif /* CONFIG_IOB_NOTIFIER */

View File

@ -151,7 +151,7 @@ void netdown_notifier_signal(FAR struct net_driver_s *dev)
{
/* This is just a simple wrapper around work_notifier_signal(). */
return work_notifier_signal(WORK_NET_DOWN, dev);
work_notifier_signal(WORK_NET_DOWN, dev);
}
#endif /* CONFIG_NETDOWN_NOTIFIER */

View File

@ -114,25 +114,11 @@ static void _netlink_semgive(FAR sem_t *sem)
static void netlink_response_available(FAR void *arg)
{
/* The entire notifier entry is passed to us. That is because we are
* responsible for disposing of the entry via kmm_free() when we are
* finished with it.
*/
FAR struct work_notifier_entry_s *notifier =
(FAR struct work_notifier_entry_s *)arg;
FAR sem_t *waitsem;
DEBUGASSERT(notifier != NULL && notifier->info.qualifier != NULL);
waitsem = (FAR sem_t *)notifier->info.arg;
/* Free the notifier entry */
kmm_free(notifier);
DEBUGASSERT(arg != NULL);
/* wakeup the waiter */
nxsem_post(waitsem);
_netlink_semgive(arg);
}
/****************************************************************************

View File

@ -144,5 +144,5 @@ void netlink_notifier_signal(FAR struct netlink_conn_s *conn)
{
/* This is just a simple wrapper around work_notifier_signal(). */
return work_notifier_signal(WORK_NETLINK_RESPONSE, conn);
work_notifier_signal(WORK_NETLINK_RESPONSE, conn);
}

View File

@ -503,21 +503,9 @@ static int netlink_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
static void netlink_response_available(FAR void *arg)
{
/* The entire notifier entry is passed to us. That is because we are
* responsible for disposing of the entry via kmm_free() when we are
* finished with it.
*/
FAR struct netlink_conn_s *conn = arg;
FAR struct work_notifier_entry_s *notifier =
(FAR struct work_notifier_entry_s *)arg;
FAR struct netlink_conn_s *conn;
DEBUGASSERT(notifier != NULL && notifier->info.qualifier != NULL);
conn = (FAR struct netlink_conn_s *)notifier->info.qualifier;
/* Free the notifier entry */
kmm_free(notifier);
DEBUGASSERT(conn != NULL);
/* The following should always be true ... but maybe not in some race
* condition?

View File

@ -269,7 +269,7 @@ void tcp_readahead_signal(FAR struct tcp_conn_s *conn)
{
/* This is just a simple wrapper around work_notifier_signal(). */
return work_notifier_signal(WORK_TCP_READAHEAD, conn);
work_notifier_signal(WORK_TCP_READAHEAD, conn);
}
/****************************************************************************
@ -298,7 +298,7 @@ void tcp_writebuffer_signal(FAR struct tcp_conn_s *conn)
{
/* This is just a simple wrapper around work_notifier_signal(). */
return work_notifier_signal(WORK_TCP_WRITEBUFFER, conn);
work_notifier_signal(WORK_TCP_WRITEBUFFER, conn);
}
#endif
@ -321,7 +321,7 @@ void tcp_disconnect_signal(FAR struct tcp_conn_s *conn)
{
/* This is just a simple wrapper around work_notifier_signal(). */
return work_notifier_signal(WORK_TCP_DISCONNECT, conn);
work_notifier_signal(WORK_TCP_DISCONNECT, conn);
}
#endif /* CONFIG_NET_TCP_NOTIFIER */

View File

@ -215,7 +215,7 @@ void udp_readahead_signal(FAR struct udp_conn_s *conn)
{
/* This is just a simple wrapper around work_notifier_signal(). */
return work_notifier_signal(WORK_UDP_READAHEAD, conn);
work_notifier_signal(WORK_UDP_READAHEAD, conn);
}
/****************************************************************************
@ -244,7 +244,7 @@ void udp_writebuffer_signal(FAR struct udp_conn_s *conn)
{
/* This is just a simple wrapper around work_notifier_signal(). */
return work_notifier_signal(WORK_UDP_WRITEBUFFER, conn);
work_notifier_signal(WORK_UDP_WRITEBUFFER, conn);
}
#endif