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

📄 ucos2_semaphore.h

📁 这是针对 Linux (i386)平台的 minigui 3.6.2 开发包(MiniGUI-Processes 运行模式)。
💻 H
字号:
/** * \file ucos2_semaphore.h * \author Wei Yongming <ymwei@minigui.org> * \date 2004/02/03 *  * semaphore.h: This header contains the pthread semaphore definitions  *              needed to support MiniGUI under uC/OS-II.  * \verbatim    Copyright (C) 2004, 2005 Feynman Software.    This file is part of MiniGUI, a compact cross-platform Graphics     User Interface (GUI) support system for real-time embedded systems.    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; if not, write to the Free Software    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    If you are using MiniGUI for developing commercial, proprietary, or other    software not covered by the GPL terms, you must have a commercial license    for MiniGUI. Please see http://www.minigui.com/product/index.html for     how to obtain this. If you are interested in the commercial MiniGUI     licensing, please write to sales@minigui.com.  \endverbatim *//* * $Id: ucos2_semaphore.h,v 1.7 2005/01/31 09:49:30 weiym Exp $ * *             MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks version 1.6.x *             Copyright (C) 2002-2005 Feynman Software. *             Copyright (C) 1998-2002 Wei Yongming. */#ifndef UCOSII_SEMAPHORE_H#define UCOSII_SEMAPHORE_H#include "common.h"#ifdef __UCOSII__#define sem_t ucos2_sem_t#define SEM_VALUE_MAX	USHRT_MAX//-----------------------------------------------------------------------------// Semaphore object definitiontypedef struct{    void* os_sema;} sem_t;//-----------------------------------------------------------------------------// Semaphore functions// Initialize semaphore to value.// pshared is not supported under uC/OS-II.int sem_init  (sem_t *sem, int pshared, unsigned int value);// Destroy the semaphore.int sem_destroy  (sem_t *sem);// Decrement value if >0 or wait for a post.int sem_wait  (sem_t *sem);// Decrement value if >0, return -1 if not.int sem_trywait  (sem_t *sem);// Increment value and wake a waiter if one is present.int sem_post  (sem_t *sem);// Get current valueint sem_getvalue  (sem_t *sem, int *sval);#if 0 /* We do not implement the named semaphore functions *///-----------------------------------------------------------------------------// Named semaphore functions// Open an existing named semaphore, or create it.sem_t *sem_open  (const char *name, int oflag, ...);// Close descriptor for semaphore.int sem_close  (sem_t *sem);// Remove named semaphoreint sem_unlink  (const char *name);//-----------------------------------------------------------------------------// Special return value for sem_open()#define SEM_FAILED      ((sem_t *)NULL)#endif /* We do not implement the named semaphore functions */#endif /* __UCOSII__ */#endif /* UCOSII_SEMAPHORE_H */

⌨️ 快捷键说明

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