X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Frmr%2Fcommon%2Finclude%2Frmr_agnostic.h;h=6ef3aee654ea42b69675fdec7e6d08cbe12efa48;hb=a1575dacc478b945ea63f5d0cc3db3d66dcb5983;hp=86f46608b4198f7512093cb5738eea8929b00d6b;hpb=ec88d3c0563eeb6ae5f73427edb0b3c4d7acf299;p=ric-plt%2Flib%2Frmr.git diff --git a/src/rmr/common/include/rmr_agnostic.h b/src/rmr/common/include/rmr_agnostic.h index 86f4660..6ef3aee 100644 --- a/src/rmr/common/include/rmr_agnostic.h +++ b/src/rmr/common/include/rmr_agnostic.h @@ -238,12 +238,18 @@ typedef struct { // --------------- ring things ------------------------------------------------- +#define RING_NONE 0 // no options +#define RING_RLOCK 0x01 // create/destroy the read lock on the ring +#define RING_WLOCK 0x02 // create/destroy the write lockk on the ring + typedef struct ring { uint16_t head; // index of the head of the ring (insert point) uint16_t tail; // index of the tail (extract point) uint16_t nelements; // number of elements in the ring void** data; // the ring data (pointers to blobs of stuff) int pfd; // event fd for the ring for epoll + pthread_mutex_t* rgate; // read lock if used + pthread_mutex_t* wgate; // write lock if used } ring_t; @@ -273,6 +279,7 @@ static char* get_default_ip( if_addrs_t* iplist ); // --- message ring -------------------------- static void* uta_mk_ring( int size ); +static int uta_ring_config( void* vr, int options ); static void uta_ring_free( void* vr ); static inline void* uta_ring_extract( void* vr ); static inline int uta_ring_insert( void* vr, void* new_data );