sem.c

来自「MANTIS是由科罗拉多大学开发的传感器网络嵌入式操作系统。 这是mantis」· C语言 代码 · 共 43 行

C
43
字号
//  This file is part of MANTIS OS, Operating System//  See http://mantis.cs.colorado.edu/////  Copyright (C) 2003,2004,2005 University of Colorado, Boulder////  This program is free software; you can redistribute it and/or//  modify it under the terms of the mos license (see file LICENSE)/**************************************************************************//* File:      sem.c                                                       *//* Author     Brian Shucker & Jeff Rose                                   *//*   Date: 05/12/04                                                       *//*                                                                        *//**************************************************************************/#include "mos.h"#include "sem.h"inline void mos_sem_init(mos_sem_t *s, int8_t value){   sem_init(s,0,value);}inline uint8_t mos_sem_try_wait(mos_sem_t *s){   if (sem_trywait(s)) {   	return SEM_FAIL;   } else {   	return SEM_SUCCESS;   }}inline void mos_sem_wait(mos_sem_t *s){   sem_wait(s);}inline void mos_sem_post(mos_sem_t *s){   sem_post(s);}

⌨️ 快捷键说明

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