Skip to content

Commit e668514

Browse files
committed
*: Rename struct thread to struct event
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <[email protected]>
1 parent cb37cb3 commit e668514

File tree

299 files changed

+1245
-1250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

299 files changed

+1245
-1250
lines changed

babeld/babeld.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
3737
DEFINE_MGROUP(BABELD, "babeld");
3838
DEFINE_MTYPE_STATIC(BABELD, BABEL, "Babel Structure");
3939

40-
static void babel_init_routing_process(struct thread *thread);
40+
static void babel_init_routing_process(struct event *thread);
4141
static void babel_get_myid(void);
4242
static void babel_initial_noise(void);
43-
static void babel_read_protocol(struct thread *thread);
44-
static void babel_main_loop(struct thread *thread);
43+
static void babel_read_protocol(struct event *thread);
44+
static void babel_main_loop(struct event *thread);
4545
static void babel_set_timer(struct timeval *timeout);
4646
static void babel_fill_with_next_timeout(struct timeval *tv);
4747
static void
@@ -163,7 +163,7 @@ babel_create_routing_process (void)
163163
}
164164

165165
/* thread reading entries form others babel daemons */
166-
static void babel_read_protocol(struct thread *thread)
166+
static void babel_read_protocol(struct event *thread)
167167
{
168168
int rc;
169169
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
@@ -199,7 +199,7 @@ static void babel_read_protocol(struct thread *thread)
199199
/* Zebra will give some information, especially about interfaces. This function
200200
must be call with a litte timeout wich may give zebra the time to do his job,
201201
making these inits have sense. */
202-
static void babel_init_routing_process(struct thread *thread)
202+
static void babel_init_routing_process(struct event *thread)
203203
{
204204
myseqno = (frr_weak_random() & 0xFFFF);
205205
babel_get_myid();
@@ -311,7 +311,7 @@ babel_clean_routing_process(void)
311311
}
312312

313313
/* Function used with timeout. */
314-
static void babel_main_loop(struct thread *thread)
314+
static void babel_main_loop(struct event *thread)
315315
{
316316
struct timeval tv;
317317
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);

babeld/babeld.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek
8484
struct babel
8585
{
8686
/* Babel threads. */
87-
struct thread *t_read; /* on Babel protocol's socket */
88-
struct thread *t_update; /* timers */
87+
struct event *t_read; /* on Babel protocol's socket */
88+
struct event *t_update; /* timers */
8989
/* distribute_ctx */
9090
struct distribute_ctx *distribute_ctx;
9191
};

bfdd/bfd.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -618,14 +618,14 @@ struct bfd_session *ptm_bfd_sess_find(struct bfd_pkt *cp,
618618
return bfd_key_lookup(key);
619619
}
620620

621-
void bfd_xmt_cb(struct thread *t)
621+
void bfd_xmt_cb(struct event *t)
622622
{
623623
struct bfd_session *bs = THREAD_ARG(t);
624624

625625
ptm_bfd_xmt_TO(bs, 0);
626626
}
627627

628-
void bfd_echo_xmt_cb(struct thread *t)
628+
void bfd_echo_xmt_cb(struct event *t)
629629
{
630630
struct bfd_session *bs = THREAD_ARG(t);
631631

@@ -634,7 +634,7 @@ void bfd_echo_xmt_cb(struct thread *t)
634634
}
635635

636636
/* Was ptm_bfd_detect_TO() */
637-
void bfd_recvtimer_cb(struct thread *t)
637+
void bfd_recvtimer_cb(struct event *t)
638638
{
639639
struct bfd_session *bs = THREAD_ARG(t);
640640

@@ -647,7 +647,7 @@ void bfd_recvtimer_cb(struct thread *t)
647647
}
648648

649649
/* Was ptm_bfd_echo_detect_TO() */
650-
void bfd_echo_recvtimer_cb(struct thread *t)
650+
void bfd_echo_recvtimer_cb(struct event *t)
651651
{
652652
struct bfd_session *bs = THREAD_ARG(t);
653653

bfdd/bfd.h

+16-16
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,12 @@ struct bfd_session {
265265
struct bfd_config_timers timers;
266266
struct bfd_timers cur_timers;
267267
uint64_t detect_TO;
268-
struct thread *echo_recvtimer_ev;
269-
struct thread *recvtimer_ev;
268+
struct event *echo_recvtimer_ev;
269+
struct event *recvtimer_ev;
270270
uint64_t xmt_TO;
271271
uint64_t echo_xmt_TO;
272-
struct thread *xmttimer_ev;
273-
struct thread *echo_xmttimer_ev;
272+
struct event *xmttimer_ev;
273+
struct event *echo_xmttimer_ev;
274274
uint64_t echo_detect_TO;
275275

276276
/* software object state */
@@ -401,8 +401,8 @@ struct bfd_control_socket {
401401
TAILQ_ENTRY(bfd_control_socket) bcs_entry;
402402

403403
int bcs_sd;
404-
struct thread *bcs_ev;
405-
struct thread *bcs_outev;
404+
struct event *bcs_ev;
405+
struct event *bcs_outev;
406406
struct bcqueue bcs_bcqueue;
407407

408408
/* Notification data */
@@ -422,7 +422,7 @@ int control_init(const char *path);
422422
void control_shutdown(void);
423423
int control_notify(struct bfd_session *bs, uint8_t notify_state);
424424
int control_notify_config(const char *op, struct bfd_session *bs);
425-
void control_accept(struct thread *t);
425+
void control_accept(struct event *t);
426426

427427

428428
/*
@@ -439,7 +439,7 @@ struct bfd_vrf_global {
439439
int bg_echov6;
440440
struct vrf *vrf;
441441

442-
struct thread *bg_ev[6];
442+
struct event *bg_ev[6];
443443
};
444444

445445
/* Forward declaration of data plane context struct. */
@@ -448,7 +448,7 @@ TAILQ_HEAD(dplane_queue, bfd_dplane_ctx);
448448

449449
struct bfd_global {
450450
int bg_csock;
451-
struct thread *bg_csockev;
451+
struct event *bg_csockev;
452452
struct bcslist bg_bcslist;
453453

454454
struct pllist bg_pllist;
@@ -466,7 +466,7 @@ struct bfd_global {
466466
/* Distributed BFD items. */
467467
bool bg_use_dplane;
468468
int bg_dplane_sock;
469-
struct thread *bg_dplane_sockev;
469+
struct event *bg_dplane_sockev;
470470
struct dplane_queue bg_dplaneq;
471471

472472
/* Debug options. */
@@ -553,15 +553,15 @@ void ptm_bfd_snd(struct bfd_session *bfd, int fbit);
553553
void ptm_bfd_echo_snd(struct bfd_session *bfd);
554554
void ptm_bfd_echo_fp_snd(struct bfd_session *bfd);
555555

556-
void bfd_recv_cb(struct thread *t);
556+
void bfd_recv_cb(struct event *t);
557557

558558

559559
/*
560560
* event.c
561561
*
562562
* Contains the code related with event loop.
563563
*/
564-
typedef void (*bfd_ev_cb)(struct thread *t);
564+
typedef void (*bfd_ev_cb)(struct event *t);
565565

566566
void bfd_recvtimer_update(struct bfd_session *bs);
567567
void bfd_echo_recvtimer_update(struct bfd_session *bs);
@@ -688,10 +688,10 @@ unsigned long bfd_get_session_count(void);
688688
/* Export callback functions for `event.c`. */
689689
extern struct thread_master *master;
690690

691-
void bfd_recvtimer_cb(struct thread *t);
692-
void bfd_echo_recvtimer_cb(struct thread *t);
693-
void bfd_xmt_cb(struct thread *t);
694-
void bfd_echo_xmt_cb(struct thread *t);
691+
void bfd_recvtimer_cb(struct event *t);
692+
void bfd_echo_recvtimer_cb(struct event *t);
693+
void bfd_xmt_cb(struct event *t);
694+
void bfd_echo_xmt_cb(struct event *t);
695695

696696
extern struct in6_addr zero_addr;
697697

bfdd/bfd_packet.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ static void cp_debug(bool mhop, struct sockaddr_any *peer,
768768
mhop ? "yes" : "no", peerstr, localstr, portstr, vrfstr);
769769
}
770770

771-
void bfd_recv_cb(struct thread *t)
771+
void bfd_recv_cb(struct event *t)
772772
{
773773
int sd = THREAD_FD(t);
774774
struct bfd_session *bfd;

bfdd/control.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ struct bfd_notify_peer *control_notifypeer_find(struct bfd_control_socket *bcs,
3939
struct bfd_control_socket *control_new(int sd);
4040
static void control_free(struct bfd_control_socket *bcs);
4141
static void control_reset_buf(struct bfd_control_buffer *bcb);
42-
static void control_read(struct thread *t);
43-
static void control_write(struct thread *t);
42+
static void control_read(struct event *t);
43+
static void control_write(struct event *t);
4444

4545
static void control_handle_request_add(struct bfd_control_socket *bcs,
4646
struct bfd_control_msg *bcm);
@@ -142,7 +142,7 @@ void control_shutdown(void)
142142
}
143143
}
144144

145-
void control_accept(struct thread *t)
145+
void control_accept(struct event *t)
146146
{
147147
int csock, sd = THREAD_FD(t);
148148

@@ -379,7 +379,7 @@ static void control_reset_buf(struct bfd_control_buffer *bcb)
379379
bcb->bcb_left = 0;
380380
}
381381

382-
static void control_read(struct thread *t)
382+
static void control_read(struct event *t)
383383
{
384384
struct bfd_control_socket *bcs = THREAD_ARG(t);
385385
struct bfd_control_buffer *bcb = &bcs->bcs_bin;
@@ -514,7 +514,7 @@ static void control_read(struct thread *t)
514514
thread_add_read(master, control_read, bcs, sd, &bcs->bcs_ev);
515515
}
516516

517-
static void control_write(struct thread *t)
517+
static void control_write(struct event *t)
518518
{
519519
struct bfd_control_socket *bcs = THREAD_ARG(t);
520520
struct bfd_control_buffer *bcb = bcs->bcs_bout;

bfdd/dplane.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ struct bfd_dplane_ctx {
6363
/** Output buffer data. */
6464
struct stream *outbuf;
6565
/** Input event data. */
66-
struct thread *inbufev;
66+
struct event *inbufev;
6767
/** Output event data. */
68-
struct thread *outbufev;
68+
struct event *outbufev;
6969
/** Connection event. */
70-
struct thread *connectev;
70+
struct event *connectev;
7171

7272
/** Amount of bytes read. */
7373
uint64_t in_bytes;
@@ -94,7 +94,7 @@ struct bfd_dplane_ctx {
9494
*/
9595
typedef void (*bfd_dplane_expect_cb)(struct bfddp_message *msg, void *arg);
9696

97-
static void bfd_dplane_client_connect(struct thread *t);
97+
static void bfd_dplane_client_connect(struct event *t);
9898
static bool bfd_dplane_client_connecting(struct bfd_dplane_ctx *bdc);
9999
static void bfd_dplane_ctx_free(struct bfd_dplane_ctx *bdc);
100100
static int _bfd_dplane_add_session(struct bfd_dplane_ctx *bdc,
@@ -312,7 +312,7 @@ static ssize_t bfd_dplane_flush(struct bfd_dplane_ctx *bdc)
312312
return total;
313313
}
314314

315-
static void bfd_dplane_write(struct thread *t)
315+
static void bfd_dplane_write(struct event *t)
316316
{
317317
struct bfd_dplane_ctx *bdc = THREAD_ARG(t);
318318

@@ -599,7 +599,7 @@ static int bfd_dplane_expect(struct bfd_dplane_ctx *bdc, uint16_t id,
599599
return 0;
600600
}
601601

602-
static void bfd_dplane_read(struct thread *t)
602+
static void bfd_dplane_read(struct event *t)
603603
{
604604
struct bfd_dplane_ctx *bdc = THREAD_ARG(t);
605605
int rv;
@@ -819,7 +819,7 @@ static uint16_t bfd_dplane_request_counters(const struct bfd_session *bs)
819819
/*
820820
* Data plane listening socket.
821821
*/
822-
static void bfd_dplane_accept(struct thread *t)
822+
static void bfd_dplane_accept(struct event *t)
823823
{
824824
struct bfd_global *bg = THREAD_ARG(t);
825825
struct bfd_dplane_ctx *bdc;
@@ -899,7 +899,7 @@ static bool bfd_dplane_client_connecting(struct bfd_dplane_ctx *bdc)
899899
}
900900
}
901901

902-
static void bfd_dplane_client_connect(struct thread *t)
902+
static void bfd_dplane_client_connect(struct event *t)
903903
{
904904
struct bfd_dplane_ctx *bdc = THREAD_ARG(t);
905905
int rv, sock;

bgpd/bgp_bmp.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ static void bmp_stat_put_u32(struct stream *s, size_t *cnt, uint16_t type,
13351335
(*cnt)++;
13361336
}
13371337

1338-
static void bmp_stats(struct thread *thread)
1338+
static void bmp_stats(struct event *thread)
13391339
{
13401340
struct bmp_targets *bt = THREAD_ARG(thread);
13411341
struct stream *s;
@@ -1388,7 +1388,7 @@ static void bmp_stats(struct thread *thread)
13881388
}
13891389

13901390
/* read from the BMP socket to detect session termination */
1391-
static void bmp_read(struct thread *t)
1391+
static void bmp_read(struct event *t)
13921392
{
13931393
struct bmp *bmp = THREAD_ARG(t);
13941394
char buf[1024];
@@ -1492,7 +1492,7 @@ static struct bmp *bmp_open(struct bmp_targets *bt, int bmp_sock)
14921492
}
14931493

14941494
/* Accept BMP connection. */
1495-
static void bmp_accept(struct thread *thread)
1495+
static void bmp_accept(struct event *thread)
14961496
{
14971497
union sockunion su;
14981498
struct bmp_listener *bl = THREAD_ARG(thread);
@@ -1902,7 +1902,7 @@ static void bmp_active_resolved(struct resolver_query *resq, const char *errstr,
19021902
bmp_active_connect(ba);
19031903
}
19041904

1905-
static void bmp_active_thread(struct thread *t)
1905+
static void bmp_active_thread(struct event *t)
19061906
{
19071907
struct bmp_active *ba = THREAD_ARG(t);
19081908
socklen_t slen;

bgpd/bgp_bmp.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct bmp {
112112

113113
int socket;
114114
char remote[SU_ADDRSTRLEN + 6];
115-
struct thread *t_read;
115+
struct event *t_read;
116116

117117
struct pullwr *pullwr;
118118

@@ -176,7 +176,7 @@ struct bmp_active {
176176
union sockunion addrs[8];
177177
int socket;
178178
const char *last_err;
179-
struct thread *t_timer, *t_read, *t_write;
179+
struct event *t_timer, *t_read, *t_write;
180180
};
181181

182182
/* config & state for passive / listening sockets */
@@ -190,7 +190,7 @@ struct bmp_listener {
190190
union sockunion addr;
191191
int port;
192192

193-
struct thread *t_accept;
193+
struct event *t_accept;
194194
int sock;
195195
};
196196

@@ -226,7 +226,7 @@ struct bmp_targets {
226226

227227
struct bmp_actives_head actives;
228228

229-
struct thread *t_stats;
229+
struct event *t_stats;
230230
struct bmp_session_head sessions;
231231

232232
struct bmp_qhash_head updhash;

bgpd/bgp_conditional_adv.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static void bgp_conditional_adv_routes(struct peer *peer, afi_t afi,
150150
/* Handler of conditional advertisement timer event.
151151
* Each route in the condition-map is evaluated.
152152
*/
153-
static void bgp_conditional_adv_timer(struct thread *t)
153+
static void bgp_conditional_adv_timer(struct event *t)
154154
{
155155
afi_t afi;
156156
safi_t safi;

bgpd/bgp_damp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ int bgp_damp_decay(time_t tdiff, int penalty, struct bgp_damp_config *bdc)
9898

9999
/* Handler of reuse timer event. Each route in the current reuse-list
100100
is evaluated. RFC2439 Section 4.8.7. */
101-
static void bgp_reuse_timer(struct thread *t)
101+
static void bgp_reuse_timer(struct event *t)
102102
{
103103
struct bgp_damp_info *bdi;
104104
struct bgp_damp_info *next;

bgpd/bgp_damp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct bgp_damp_config {
9292
struct bgp_damp_info *no_reuse_list;
9393

9494
/* Reuse timer thread per-set base. */
95-
struct thread *t_reuse;
95+
struct event *t_reuse;
9696

9797
afi_t afi;
9898
safi_t safi;

0 commit comments

Comments
 (0)