Ejemplo n.º 1
0
//---------------------------------------------------------------------------
static void Semaphore_Flyback( Semaphore_t *pstSe )
{    

    ProfileTimer_Start( &stSemaphoreFlyback );
    Semaphore_Pend( pstSe );
    ProfileTimer_Stop( &stSemaphoreFlyback );
    
    Thread_Exit( Scheduler_GetCurrentThread() );
}
Ejemplo n.º 2
0
//---------------------------------------------------------------------------
static void Thread_ProfilingThread()
{
    // Stop the "Thread_t start" profiling timer, which was started from the
    // main app Thread_t
    ProfileTimer_Stop( &stThreadStartTimer );
    
    // Start the "Thread_t exit" profiling timer, which will be stopped after
    // returning back to the main app Thread_t
    ProfileTimer_Start( &stThreadExitTimer );
    Thread_Exit( Scheduler_GetCurrentThread() );
}
Ejemplo n.º 3
0
TEST_END

//===========================================================================
TEST(ut_thread_exit)
{
    // Test point - force a Thread_t exit; ensure it doesn't respond once
    // it's un-scheduled.
    Thread_Exit( &stThread1 );
    Semaphore_Post( &stSem2 );
    Semaphore_TimedPend( &stSem1, 100 );

    EXPECT_TRUE( Thread_GetExpired( Scheduler_GetCurrentThread() ) );
}
int test( char szBaseDatos[])
{
	int id=0;
	Conexion[id].dbconn=OpenDatabaseMSSQL(id);
 	if (Conexion[id].dbconn==NULL)
	{
		printf("(%02i) Falla Conexion a BD",id);
		exit(1);
	}
	//GetOneRecordMSSQL(id,Conexion[id].nSocket,"SELECT * FROM mc_giro_actividad_economica",Conexion[id].dbconn);//Descomentar cuando este implementado
        GetCamposMSSQL(id,Conexion[id].nSocket,"LISTADO_RPT",Conexion[id].dbconn);//(int id,int nSocket,char szTabla[],DBPROCESS *dbconn)
	Thread_Exit(id);
}
Ejemplo n.º 5
0
static void Thread_tSleepEntryPoint(void *unused_)
{
    unused_ = unused_;

    // Thread_t will sleep for various intervals, synchronized
    // to Semaphore_t-based IPC.
    Semaphore_Pend( &stSem1 );
    Thread_Sleep(5);
    Semaphore_Post( &stSem2 );

    Semaphore_Pend( &stSem1 );
    Thread_Sleep(50);
    Semaphore_Post( &stSem2 );

    Semaphore_Pend( &stSem1 );
    Thread_Sleep(500);
    Semaphore_Post( &stSem2 );

    // Exit this Thread_t.
    Thread_Exit( Scheduler_GetCurrentThread() );
}