⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_osapi_task.c

📁 这是DVD中伺服部分的核心代码
💻 C
字号:
/*****************************************************************************
******************************************************************************
**                                                                          **
**  Copyright (c) 2006 Videon Central, Inc.                                 **
**  All rights reserved.                                                    **
**                                                                          **
**  The computer program contained herein contains proprietary information  **
**  which is the property of Videon Central, Inc.  The program may be used  **
**  and/or copied only with the written permission of Videon Central, Inc.  **
**  or in accordance with the terms and conditions stipulated in the        **
**  agreement/contract under which the programs have been supplied.         **
**                                                                          **
******************************************************************************
*****************************************************************************/
/**
 * @file test_osapi_task.c
 *
 * $Revision: 1.3 $ 
 *
 * Operating System API (OSAPI) test file. 
 *
 */

#include "vdvd_types.h"
#include "osapi.h"
#include "dbgprint.h"
#include "test_osapi.h"

#define STACK_SIZE  8*1024

ULONG Thread1EntryPoint( void )
{
    DbgPrint(("\nThread1 running\n"));

    OS_TaskDelay( 1000 );    

    DbgPrint(("Thread1 exiting\n"));

    return 0;
}


void OSAPITaskTests( void )
{
    OS_STATUS   status;
    ULONG       iThread1ID;

    DbgPrint(("\n\nOSAPI TASK TESTS\n"));

    DbgPrint(("[running] Test 1: create thread"));
    iThread1ID = OS_TaskSpawn("Task1", 4, STACK_SIZE, Thread1EntryPoint);
    PassFail( (iThread1ID!=0) );

    OS_TaskDelay(500);  // Wait for thread to start

    DbgPrint(("[running] Test 2:  join thread"));
    status = OS_TaskJoin(iThread1ID);
    PassFail( (status==OS_OK) );

    DbgPrint(("[running] Test 3:  delete thread"));
    OS_TaskDelete(iThread1ID);
    PassFail( (status==OS_OK) );

    DbgPrint(("\nOSAPI TASK TEST FINISHED\n"));
}



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -