Пример #1
0
static void
timer_test(void)
{
    htimer_t *tm;

    tm = timer_new("1");
    add_timer(tm, 1);
    tm = timer_new("2");
    add_timer(tm, 2);
    tm = timer_new("3");
    add_timer(tm, 3);
    tm = timer_new("11");
    add_timer(tm, 11);
    timer_thread(1);
    timer_thread(10);
    timer_thread(12);
}
Пример #2
0
int MainControl::on_enter_thread()
{
	CMD::load_command();
    CMD::disp_intro();
    CMD::disp_prompt();
	
    timer_thread(CLS_CREATE_START);

	return RET_SUCCESS;
}
Пример #3
0
void MainControl::on_exit_thread()
{
#if defined(DEBUG)
	cout << "MainControl exit thread!\n";
#endif

////////////////////////////////////////////////////////////////
// stop timer thread
////////////////////////////////////////////////////////////////
#if defined(DEBUG)
	cout << "start timer exit thread!\n";
	timer_thread(CLS_STOP);
	cout << "finish timer exit thread!\n";
#else
	timer_thread(CLS_STOP);
#endif
 
////////////////////////////////////////////////////////////////
// stop market socket listen
////////////////////////////////////////////////////////////////
#if defined(DEBUG)
	cout << "start socket listen exit thread!\n";
	mkt_socket_listen(CLS_STOP);
	cout << "Socket Listener stop thread!\n";
#else
	mkt_socket_listen(CLS_STOP);
#endif
 
////////////////////////////////////////////////////////////////
// stop idx socket data thread
////////////////////////////////////////////////////////////////
#if defined(DEBUG)
	cout << "start socket data exit thread!\n";
	idx_socket_data(CLS_STOP);
	cout << "socket data stop thread!\n";
#else
	idx_socket_data(CLS_STOP);
#endif
    
////////////////////////////////////////////////////////////////
// stop idx data manager thread
////////////////////////////////////////////////////////////////
#if defined(DEBUG)
	cout << "start data manager exit thread!\n";
	idx_data_manager(CLS_STOP);
	cout << "data manager stop thread!\n";
#else
	idx_data_manager(CLS_STOP);
#endif
    
////////////////////////////////////////////////////////////////
// stop market client manager thread
////////////////////////////////////////////////////////////////
#if defined(DEBUG)
	cout << "start mkt client mgr exit thread!\n";
	mkt_client_manager(CLS_STOP);
	cout << "Client Manager stop thread!\n";
#else
	mkt_client_manager(CLS_STOP);
#endif

////////////////////////////////////////////////////////////////
// stop data storage manager thread
////////////////////////////////////////////////////////////////
#if defined(DEBUG)
	cout << "start data storage exit thread!\n";
#endif
	data_storage(CLS_STOP);
#if defined(DEBUG)
	cout << "Data Storage stop thread!\n";
#endif

	destroy_objects();
}