winsync.c
来自「MinGUI 可视化程序代码」· C语言 代码 · 共 70 行
C
70 行
/******************************************************************************** Copyright 2006 National ASIC Center, All right Reserved** FILE NAME: winsync.c* PROGRAMMER: ming.c* Date of Creation: 2006/08/8** DESCRIPTION: * Semaphore * NOTE: ** FUNCTIONS LIST:* -----------------------------------------------------------------------------** -----------------------------------------------------------------------------** MODIFICATION HISTORY* LastModify 2006/09/18******************************************************************************/#include "wingal.h"/*###########################################################################*/#if BASE_OS_TYPE==2 /*NUCLEUS OS操作系统下*//*###########################################################################*/#include "nucleus.h"//---------------------------------------------------------------------------DWORD Semaphore_Create(){ NU_SEMAPHORE *MsgTskSemaphore=(NU_SEMAPHORE *)GetMem(sizeof(NU_SEMAPHORE)); /*定义NUCLEUS下信号量*/ if(MsgTskSemaphore) { NU_Create_Semaphore(MsgTskSemaphore,"MsgTskSemaphore", 0, NU_FIFO); } return (DWORD)MsgTskSemaphore;}//---------------------------------------------------------------------------void Semaphore_Destroy(DWORD Semaphore){ NU_Delete_Semaphore((NU_SEMAPHORE *)Semaphore); FreeMem((NU_SEMAPHORE *)Semaphore);}//---------------------------------------------------------------------------void Semaphore_Obtain(DWORD Semaphore){ NU_Obtain_Semaphore((NU_SEMAPHORE *)Semaphore, NU_SUSPEND);}//---------------------------------------------------------------------------void Semaphore_Release(DWORD Semaphore){ NU_Release_Semaphore((NU_SEMAPHORE *)Semaphore);}/*###########################################################################*/#elif BASE_OS_TYPE==3 /*Asix OS操作系统下*//*###########################################################################*///---------------------------------------------------------------------------DWORD Semaphore_Create(){ /*待实现*/}//---------------------------------------------------------------------------void Semaphore_Destroy(DWORD Semaphore){ /*待实现*/}//---------------------------------------------------------------------------void Semaphore_Obtain(DWORD Semaphore){ /*待实现*/}//---------------------------------------------------------------------------void Semaphore_Release(DWORD Semaphore){ /*待实现*/}/*###########################################################################*/#endif/*###########################################################################*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?