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

📄 semaphi.h

📁 本程序为ST公司开发的源代码
💻 H
字号:
/* * semaphi.h * * Copyright (C) STMicroelectronics Ltd. 1998 * * Header file for semaphore operations. */#ifndef _semaphi_h#define _semaphi_h/* * The standard for function and data naming in this module is: * * sempahore                       Compulsary prefix * wait|signal|init|uninit         Function prefix * fifo|priority|generic|genericsw Semaphore type * timeout|infinity|notimeout      Options * class                           Class suffix * * To clarify the timeout options: *  <none>     is when no timeout is specified, and is implemented directly *  _timout    is when a timeout has been specified and implemented directly *  _infinity  is when no timeout is specified, but is implemented in *               terms of a timeout version (ie TIMEOUT_INFINITY is *               added to the parameter list, and _timeout version called). *  _notimeout is when a timeout is specified but no implementation has been *               provided, and so the timeout parameter is ignored (ie *               <none> version is called and 0 returned). * * generic is an operation which can be applied to any sempahore. * genericsw is a subset which can only be applied to semaphores which *   are implemented in software. */typedef struct semaphore_class_s{  void (*semaphore_class_delete)(semaphore_t* sem);  /*void (*semaphore_class_signal)(semaphore_t* sem);*/  void (*semaphore_class_wait)(semaphore_t* sem);  int  (*semaphore_class_wait_timeout)(semaphore_t* sem, const osclock_t *time);} semaphore_class_t;void         semaphore_init_generic (semaphore_t *semaphore, int count, struct semaphore_class_s *class);semaphore_t* semaphore_create_generic (int count, struct semaphore_class_s *class);void         semaphore_uninit_generic (semaphore_t* semaphore);void         semaphore_uncreate_generic (semaphore_t* semaphore);void         os_semaphore_queue_remove (task_t* task);void         os_semaphore_signal (semaphore_t* semaphore);void         os_semaphore_wait_fifo (semaphore_t* semaphore);void 	     os_semaphore_wait_fifo_timeout (semaphore_t* semaphore, osclock_t* timeout);  void         os_semaphore_wait_priority (semaphore_t* semaphore);void         os_semaphore_wait_priority_timeout (semaphore_t* semaphore, osclock_t* timeout);void         os_task_deschedule (void);void         os_task_reschedule (void);void         os_task_schedule (task_t* task);void         report_semaphores (void);#endif

⌨️ 快捷键说明

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