gnrc_netreg: use thread_has_msg_queue() for msg queue check

This commit is contained in:
Martine Lenders 2018-11-15 14:07:15 +01:00 committed by Martine Lenders
parent 986b9d380b
commit a14e33df01

View File

@ -40,12 +40,11 @@ void gnrc_netreg_init(void)
int gnrc_netreg_register(gnrc_nettype_t type, gnrc_netreg_entry_t *entry)
{
#if DEVELHELP
# if defined(MODULE_GNRC_NETAPI_MBOX) || defined(MODULE_GNRC_NETAPI_CALLBACKS)
bool has_msg_q = (entry->type != GNRC_NETREG_TYPE_DEFAULT) ||
(sched_threads[entry->target.pid]->msg_array != NULL);
thread_has_msg_queue(sched_threads[entry->target.pid]);
# else
bool has_msg_q = (sched_threads[entry->target.pid]->msg_array != NULL);
bool has_msg_q = thread_has_msg_queue(sched_threads[entry->target.pid]);
# endif
/* only threads with a message queue are allowed to register at gnrc */