mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
rpl: removing unnecessary recv_mutex
In the main function of RPL (rpl_process thread) a mutex is used after receiving a message via msg_recv. However, this mutex is never used in another thread and thus is rendered obsolete.
This commit is contained in:
parent
312e2b10a8
commit
42d0fe3f78
@ -47,9 +47,6 @@ extern "C" {
|
|||||||
extern kernel_pid_t rpl_process_pid;
|
extern kernel_pid_t rpl_process_pid;
|
||||||
extern uint8_t rpl_max_routing_entries;
|
extern uint8_t rpl_max_routing_entries;
|
||||||
|
|
||||||
/* needed for receiving messages with ICMP-code 155. Received via IPC from ipv6.c */
|
|
||||||
extern mutex_t rpl_recv_mutex;
|
|
||||||
|
|
||||||
/* needed for sending RPL-messages */
|
/* needed for sending RPL-messages */
|
||||||
extern mutex_t rpl_send_mutex;
|
extern mutex_t rpl_send_mutex;
|
||||||
|
|
||||||
|
@ -54,7 +54,6 @@ char addr_str[IPV6_MAX_ADDR_STR_LEN];
|
|||||||
|
|
||||||
/* global variables */
|
/* global variables */
|
||||||
kernel_pid_t rpl_process_pid = KERNEL_PID_UNDEF;
|
kernel_pid_t rpl_process_pid = KERNEL_PID_UNDEF;
|
||||||
mutex_t rpl_recv_mutex = MUTEX_INIT;
|
|
||||||
mutex_t rpl_send_mutex = MUTEX_INIT;
|
mutex_t rpl_send_mutex = MUTEX_INIT;
|
||||||
msg_t rpl_msg_queue[RPL_PKT_RECV_BUF_SIZE];
|
msg_t rpl_msg_queue[RPL_PKT_RECV_BUF_SIZE];
|
||||||
char rpl_process_buf[RPL_PROCESS_STACKSIZE];
|
char rpl_process_buf[RPL_PROCESS_STACKSIZE];
|
||||||
@ -163,7 +162,6 @@ void *rpl_process(void *arg)
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
msg_receive(&m_recv);
|
msg_receive(&m_recv);
|
||||||
mutex_lock(&rpl_recv_mutex);
|
|
||||||
|
|
||||||
/* differentiate packet types */
|
/* differentiate packet types */
|
||||||
ipv6_buf = ((ipv6_hdr_t *)m_recv.content.ptr);
|
ipv6_buf = ((ipv6_hdr_t *)m_recv.content.ptr);
|
||||||
@ -179,30 +177,25 @@ void *rpl_process(void *arg)
|
|||||||
switch (icmp_buf->code) {
|
switch (icmp_buf->code) {
|
||||||
case (ICMP_CODE_DIS): {
|
case (ICMP_CODE_DIS): {
|
||||||
rpl_recv_DIS();
|
rpl_recv_DIS();
|
||||||
mutex_unlock(&rpl_recv_mutex);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case (ICMP_CODE_DIO): {
|
case (ICMP_CODE_DIO): {
|
||||||
rpl_recv_DIO();
|
rpl_recv_DIO();
|
||||||
mutex_unlock(&rpl_recv_mutex);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case (ICMP_CODE_DAO): {
|
case (ICMP_CODE_DAO): {
|
||||||
rpl_recv_DAO();
|
rpl_recv_DAO();
|
||||||
mutex_unlock(&rpl_recv_mutex);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case (ICMP_CODE_DAO_ACK): {
|
case (ICMP_CODE_DAO_ACK): {
|
||||||
rpl_recv_DAO_ACK();
|
rpl_recv_DAO_ACK();
|
||||||
mutex_unlock(&rpl_recv_mutex);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
mutex_unlock(&rpl_recv_mutex);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -238,7 +231,6 @@ void *rpl_process(void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_unlock(&rpl_recv_mutex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user