int osip_fifo_insert (osip_fifo_t * ff, void *el) { #ifdef OSIP_MT osip_mutex_lock (ff->qislocked); #endif if (ff->etat != plein) { /* ff->nb_elt++; */ osip_list_add (ff->queue, el, 0); /* insert at end of queue */ } else { OSIP_TRACE (osip_trace (__FILE__, __LINE__, OSIP_WARNING, NULL, "too much traffic in fifo.\n")); #ifdef OSIP_MT osip_mutex_unlock (ff->qislocked); #endif return -1; /* stack is full */ } /* if (ff->nb_elt >= MAX_LEN) */ if (osip_list_size (ff->queue) >= MAX_LEN) ff->etat = plein; else ff->etat = ok; #ifdef OSIP_MT osip_sem_post (ff->qisempty); osip_mutex_unlock (ff->qislocked); #endif return 0; }
int osip_cond_signal (struct osip_cond *_cond) { if (!_cond) return -1; return osip_sem_post (_cond->sem); }
int osip_cond_signal (struct osip_cond *_cond) { return osip_sem_post (_cond->sem); }