{
struct bgp_proto *p = (void *) C->proto;
struct bgp_channel *c = (void *) C;
- log("in bgp");
/* Ignore non-BGP channels */
if (C->class != &channel_bgp)
struct ospf_proto *p = (struct ospf_proto *) C->proto;
if (cir) {
- pthread_mutex_lock(&p->mutex);
+ if (p->lock == NULL)
+ {
+ p->lock = DOMAIN_NEW(attrs);
+ DOMAIN_SETUP(attrs, p->lock, "Partial request lock ospf", NULL);
+ }
+ DG_LOCK(p->lock);
cir->next = p->cir;
p->cir = cir;
- pthread_mutex_unlock(&p->mutex);
+ DG_UNLOCK(p->lock);
}
if (p->calcrt == 2)
return 1;
#ifndef _BIRD_OSPF_H_
#define _BIRD_OSPF_H_
-#include <pthread.h>
#include "nest/bird.h"
#include "lib/checksum.h"
int calcrt; /* Routing table calculation scheduled?
0=no, 1=normal, 2=forced reload */
struct channel_import_request *cir; /* Struct with trie for partial reload */
- pthread_mutex_t mutex; /* Mutex for partial reload */
+ DOMAIN(attrs) lock; /*nebo struct domain_generic *? *//* Lock for partial reload */
list iface_list; /* List of OSPF interfaces (struct ospf_iface) */
list area_list; /* List of OSPF areas (struct ospf_area) */
int areano; /* Number of area I belong to */
OSPF_TRACE(D_EVENTS, "Starting routing table synchronization");
- pthread_mutex_lock(&p->mutex);
+ DG_LOCK(attr, p->lock);
struct channel_import_request *cir = p->cir;
p->cir = NULL;
- pthread_mutex_unlock(&p->mutex);
+ DG_UNLOCK(attr, p->lock);
DBG("Now syncing my rt table with nest's\n");
FIB_ITERATE_INIT(&fit, fib);
FIB_ITERATE_INIT(&fit, &p->rtable);
- pthread_mutex_lock(&p->mutex);
+ DG_LOCK(attrs, p->lock);
struct channel_import_request *cir = p->cir;
p->cir = NULL;
- pthread_mutex_unlock(&p->mutex);
+ DG_UNLOCK(attrs, p->lock);
loop:
FIB_ITERATE_START(&p->rtable, &fit, struct rip_entry, en)
struct rip_proto *p = (struct rip_proto *) C->proto;
if (cir) {
- pthread_mutex_lock(&p->mutex);
+ if (p->lock==NULL)
+ {
+ p->lock = DOMAIN_NEW(attrs);
+ DOMAIN_SETUP(attrs, p->lock, "Partial request lock rip", NULL);
+ }
+ DG_LOCK(p->lock);
cir->next = p->cir;
p->cir = cir;
- pthread_mutex_lock(&p->mutex);
+ DG_UNLOCK(p->lock);
}
if (p->rt_reload)
return 1;
#ifndef _BIRD_RIP_H_
#define _BIRD_RIP_H_
-#include <pthread.h>
#include "nest/bird.h"
#include "nest/cli.h"
#include "nest/iface.h"
struct tbf log_pkt_tbf; /* TBF for packet messages */
struct tbf log_rte_tbf; /* TBF for RTE messages */
struct channel_import_request *cir; /* Trie for partial reload */
- pthread_mutex_t mutex; /* Mutex for partial reload */
+ DOMAIN(attrs) lock; /* Lock for partial reload */
};
struct rip_iface