3737/* lwrb header */
3838#include <lwrb/lwrb.h>
3939
40- static void flb_ring_buffer_unregister (struct flb_ring_buffer * rb );
40+ static void flb_ring_buffer_remove_event_loop (struct flb_ring_buffer * rb );
4141
4242struct flb_ring_buffer * flb_ring_buffer_create (uint64_t size )
4343{
@@ -81,7 +81,7 @@ struct flb_ring_buffer *flb_ring_buffer_create(uint64_t size)
8181
8282void flb_ring_buffer_destroy (struct flb_ring_buffer * rb )
8383{
84- flb_ring_buffer_unregister (rb );
84+ flb_ring_buffer_remove_event_loop (rb );
8585
8686 if (rb -> data_buf ) {
8787 flb_free (rb -> data_buf );
@@ -94,7 +94,7 @@ void flb_ring_buffer_destroy(struct flb_ring_buffer *rb)
9494 flb_free (rb );
9595}
9696
97- int flb_ring_buffer_register (struct flb_ring_buffer * rb , void * evl , uint8_t window_size )
97+ int flb_ring_buffer_add_event_loop (struct flb_ring_buffer * rb , void * evl , uint8_t window_size )
9898{
9999 int result ;
100100
@@ -126,8 +126,6 @@ int flb_ring_buffer_register(struct flb_ring_buffer *rb, void *evl, uint8_t wind
126126
127127 MK_EVENT_ZERO (rb -> signal_event );
128128
129- ((struct mk_event * ) rb -> signal_event )-> data = (void * ) rb ;
130-
131129 result = mk_event_add (evl ,
132130 rb -> signal_channels [0 ],
133131 FLB_ENGINE_EV_THREAD_INPUT ,
@@ -148,7 +146,7 @@ int flb_ring_buffer_register(struct flb_ring_buffer *rb, void *evl, uint8_t wind
148146 return 0 ;
149147}
150148
151- static void flb_ring_buffer_unregister (struct flb_ring_buffer * rb )
149+ static void flb_ring_buffer_remove_event_loop (struct flb_ring_buffer * rb )
152150{
153151 if (rb -> event_loop != NULL ) {
154152 mk_event_del (rb -> event_loop , rb -> signal_event );
0 commit comments