Lines Matching refs:msgqueue
17 int uvoice_msgqueue_recv(uvoice_msgqueue_t *msgqueue, int type, void *msg, int size, int timeout) in uvoice_msgqueue_recv() argument
20 return msgrcv(msgqueue->qid, msg, size, type, flag); in uvoice_msgqueue_recv()
23 int uvoice_msgqueue_send(uvoice_msgqueue_t *msgqueue, void *msg, int size, int block) in uvoice_msgqueue_send() argument
26 return msgsnd(msgqueue->qid, msg, size, flag); in uvoice_msgqueue_send()
31 uvoice_msgqueue_t *msgqueue; in uvoice_msgqueue_create() local
44 msgqueue = snd_zalloc(sizeof(uvoice_msgqueue_t), AFM_EXTN); in uvoice_msgqueue_create()
45 if (!msgqueue) { in uvoice_msgqueue_create()
49 msgqueue->id = id; in uvoice_msgqueue_create()
54 snd_free(msgqueue); in uvoice_msgqueue_create()
58 msgqueue->id = msgget(key, IPC_CREAT|0666); in uvoice_msgqueue_create()
59 if (msgqueue->id == -1) { in uvoice_msgqueue_create()
61 snd_free(msgqueue); in uvoice_msgqueue_create()
65 msgqueue->lock = os_mutex_new(); in uvoice_msgqueue_create()
66 msgqueue->recv_sem = os_sem_new(0); in uvoice_msgqueue_create()
68 return msgqueue; in uvoice_msgqueue_create()
72 int uvoice_msgqueue_release(uvoice_msgqueue_t *msgqueue) in uvoice_msgqueue_release() argument
74 if (!msgqueue) { in uvoice_msgqueue_release()
79 os_sem_free(msgqueue->recv_sem); in uvoice_msgqueue_release()
80 os_mutex_free(msgqueue->lock); in uvoice_msgqueue_release()
82 snd_free(msgqueue); in uvoice_msgqueue_release()