| 43 | |
| 44 | |
| 45 | int dm_init_peer(void) |
| 46 | { |
| 47 | struct { |
| 48 | struct list_head queue; |
| 49 | pthread_cond_t cond; |
| 50 | pthread_mutex_t mutex; |
| 51 | } *wrap; |
| 52 | |
| 53 | wrap = shm_malloc(sizeof *wrap); |
| 54 | if (!wrap) { |
| 55 | LM_ERR("oom\n"); |
| 56 | return -1; |
| 57 | } |
| 58 | |
| 59 | msg_send_queue = &wrap->queue; |
| 60 | INIT_LIST_HEAD(msg_send_queue); |
| 61 | |
| 62 | msg_send_lk = &wrap->mutex; |
| 63 | msg_send_cond = &wrap->cond; |
| 64 | |
| 65 | init_mutex_cond(msg_send_lk, msg_send_cond); |
| 66 | |
| 67 | INIT_LIST_HEAD(&dm_unreplied_req); |
| 68 | lock_init(&dm_unreplied_req_lk); |
| 69 | return 0; |
| 70 | } |
| 71 | |
| 72 | |
| 73 | static inline int dm_add_session(struct msg *msg, struct dict_object *model) |
no test coverage detected