1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-29 00:11:16 +01:00

gnrc_ipv6_nib: make mutex private

This commit is contained in:
Martine S. Lenders 2019-10-11 12:18:52 +02:00
parent a14e834ad8
commit 01351206d5
2 changed files with 13 additions and 14 deletions

View File

@ -42,10 +42,10 @@ static _nib_dr_entry_t _def_routers[GNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF];
#if GNRC_IPV6_NIB_CONF_MULTIHOP_P6C
static _nib_abr_entry_t _abrs[GNRC_IPV6_NIB_ABR_NUMOF];
#endif /* GNRC_IPV6_NIB_CONF_MULTIHOP_P6C */
static mutex_t _nib_mutex = MUTEX_INIT;
static char addr_str[IPV6_ADDR_MAX_STR_LEN];
mutex_t _nib_mutex = MUTEX_INIT;
evtimer_msg_t _nib_evtimer;
static void _override_node(const ipv6_addr_t *addr, unsigned iface,
@ -68,6 +68,16 @@ void _nib_init(void)
/* TODO: load ABR information from persistent memory */
}
void _nib_acquire(void)
{
mutex_lock(&_nib_mutex);
}
void _nib_release(void)
{
mutex_unlock(&_nib_mutex);
}
static inline bool _addr_equals(const ipv6_addr_t *addr,
const _nib_onl_entry_t *node)
{

View File

@ -241,11 +241,6 @@ typedef struct {
BITFIELD(ctxs, GNRC_SIXLOWPAN_CTX_SIZE);
} _nib_abr_entry_t;
/**
* @brief Mutex for locking the NIB
*/
extern mutex_t _nib_mutex;
/**
* @brief Event timer for the NIB.
*/
@ -269,18 +264,12 @@ void _nib_init(void);
/**
* @brief Acquire exclusive access to the NIB
*/
static inline void _nib_acquire(void)
{
mutex_lock(&_nib_mutex);
}
void _nib_acquire(void);
/**
* @brief Release exclusive access to the NIB
*/
static inline void _nib_release(void)
{
mutex_unlock(&_nib_mutex);
}
void _nib_release(void);
/**
* @brief Gets interface identifier from a NIB entry