Example #1
0
static int run_threads(void)
{
	int ret;
	
	if(dmb_thread_run == 1)
		return 0;

	dmb_thread_run = 1;
	
	tsp_buf_init();
	mrevent_init(&ts_read_event);
		
	ret = pthread_create(&tsp_read_thread_cb, NULL, dmb_read_thread, NULL);
	if(ret < 0)
	{
		printf("thread create error: %d\n", ret);
		return ret;
	}

	ret = pthread_create(&tsp_consumer_thread_cb, NULL, dmb_consumer_thread, NULL);
	if(ret < 0)
	{
		printf("thread create error: %d\n", ret);
		return ret;
	}	

	return ret;
}
Example #2
0
	sync_flag()
	{
		m_event = new mrevent;
		mrevent_init(m_event);
	}