MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / msg_list_init

Function msg_list_init

modules/msilo/ms_msg_list.c:86–113  ·  view source on GitHub ↗

* init a list */

Source from the content-addressed store, hash-verified

84 * init a list
85 */
86msg_list msg_list_init(void)
87{
88 msg_list ml = NULL;
89
90 ml = (msg_list)shm_malloc(sizeof(t_msg_list));
91 if(ml == NULL)
92 return NULL;
93 /* init locks */
94 if (lock_init(&ml->sem_sent)==0){
95 LM_CRIT("could not initialize a lock\n");
96 goto clean;
97 };
98 if (lock_init(&ml->sem_done)==0){
99 LM_CRIT("could not initialize a lock\n");
100 lock_destroy(&ml->sem_sent);
101 goto clean;
102 };
103 ml->nrsent = 0;
104 ml->nrdone = 0;
105 ml->lsent = NULL;
106 ml->ldone = NULL;
107
108 return ml;
109
110clean:
111 shm_free(ml);
112 return NULL;
113}
114
115/**
116 * free a list

Callers 1

mod_initFunction · 0.85

Calls 4

shm_mallocFunction · 0.85
lock_initFunction · 0.85
lock_destroyFunction · 0.85
shm_freeFunction · 0.85

Tested by

no test coverage detected