rootfs/aboriginal-1.4.5/sources/root-filesystem/src/thread-hello2.c
// Send a block of data through mailbox.
Send a block of data through mailbox.
Send a block of data through mailbox .
void thread_send(struct thread_info *ti, char *data, unsigned len)
{
	pthread_mutex_lock(&(ti->wakeup_mutex));
	if (ti->len)
		pthread_cond_wait(&(ti->wakeup_send), &(ti->wakeup_mutex));
	ti->data = data;
	ti->len = len;
	pthread_cond_signal(&(ti->wakeup_receive));
	pthread_mutex_unlock(&(ti->wakeup_mutex));
}
void thread_send ( struct thread_info * ti , char * data , unsigned len ) { pthread_mutex_lock ( & ( ti -> wakeup_mutex ) ) ; if ( ti -> len ) pthread_cond_wait ( & ( ti -> wakeup_send ) , & ( ti -> wakeup_mutex ) ) ; ti -> data = data ; ti -> len = len ; pthread_cond_signal ( & ( ti -> wakeup_receive ) ) ; pthread_mutex_unlock ( & ( ti -> wakeup_mutex ) ) ; }
Send a block of data through mailbox.
Send a block of data through mailbox .
// If consumer hasn't consumed yet, wait for them to do so.