cyg_flag 系列函数
http://blog.csdn.net/mrwangwang/article/details/7954236
| cyg_flag_init | |
| Name: | cyg_flag_init ( ) - initialize a flag for use |
|---|---|
| Synopsis: |
void cyg_flag_init |
| Description: | This initializes a flag for use. Flags are synchronization mechanism that allows threads to wait on a condition or a set of conditions. Each condition is represented as a bit. Bits are user defined. |
| Include: | #include <cyg/kernel/kapi.h> |
| Returns: | nothing |
| See Also: | cyg_flag_destroy |
| cyg_flag_destroy | |
| Name: | cyg_flag_destroy ( ) - destroy (invalidate) a flag |
|---|---|
| Synopsis: |
void cyg_flag_destroy |
| Description: | This destroys or invalidates a flag. Be certain that no threads are waiting on or otherwise using a flag when you call this function or you may deadlock the system. |
| Include: | #include <cyg/kernel/kapi.h> |
| Returns: | nothing |
| See Also: | cyg_flag_init |
| cyg_flag_setbits | |
| Name: | cyg_flag_setbits ( ) - set bits (conditions) in a flag |
|---|---|
| Synopsis: |
void cyg_flag_setbits |
| Description: | This sets bits (conditions) to true in a flag. Any bit in "value" that is set to true (1) will set the equivalent bit in the flag. This may wake threads waiting on this flag as a result. |
| Include: | #include <cyg/kernel/kapi.h> |
| Returns: | nothing |
| See Also: | cyg_flag_maskbits, cyg_flag_wait, cyg_flag_timed_wait, cyg_flag_poll, cyg_flag_peek, cyg_flag_waiting |
| cyg_flag_maskbits | |
| Name: | cyg_flag_maskbits ( ) - clear conditions (bits) in a flag |
|---|---|
| Synopsis: |
void cyg_flag_maskbits |
| Description: | This clears bits (conditions) in a flag. Any bit that is set to false (0) in "value" will be subsequently cleared in the flag. If "value" is set to 0, all conditions will be cleared, if "value" is set to all ones, no conditions will be cleared. Since this just clears conditions, no thread will run as a result of a call to this function. |
| Include: | #include <cyg/kernel/kapi.h> |
| Returns: | nothing |
| See Also: | cyg_flag_setbits, cyg_flag_wait, cyg_flag_timed_wait, cyg_flag_poll, cyg_flag_peek, cyg_flag_waiting |
| cyg_flag_wait | |
| Name: | cyg_flag_wait ( ) - wait forever on a flag |
|---|---|
| Synopsis: |
cyg_flag_value_t cyg_flag_wait |
| Description: | This causes the calling thread to wait on a set of bits (conditions) to be set in a given flag. The "mode" indicates how the pattern will be interpreted:
CYG_FLAG_WAITMODE_AND - return match if all conditions in the pattern are set in the flag CYG_FLAG_WAITMODE_OR - return match if any of the conditions in the pattern are set in the flag. CYG_FLAG_WAITMODE_CLR - automatically clear the conditions that caused the calling thread to return a match, IF there was a match. CYG_FLAG_WAITMODE_CLR can be combined with CYG_FLAG_WAITMODE_AND or CYG_FLAG_WAITMODE_OR to clear the bits that caused the condition to be met by oring the bitfields together. If the conditions are met, the pattern that caused the pattern match is returned. A value of 0 will be returned if the thread was awakened for another reason other than a pattern match or a bad value was specified as the mode. |
| Include: | #include <cyg/kernel/kapi.h> |
| Returns: | the pattern that caused a match or 0 if an error. |
| See Also: | cyg_flag_setbits, cyg_flag_maskbits, cyg_flag_timed_wait, cyg_flag_poll, cyg_flag_peek, cyg_flag_waiting |
| cyg_flag_timed_wait | |
| Name: | cyg_flag_timed_wait ( ) - wait on a flag until timeout |
|---|---|
| Synopsis: |
cyg_flag_value_t cyg_flag_timed_wait |
| Description: | This causes the calling thread to wait on a set of bits (conditions) to be set in a given flag. If the system clock goes beyond "abstime" the wait will timeout and an error will be returned. The "mode" indicates how the pattern will be interpreted:
CYG_FLAG_WAITMODE_AND - return match if all conditions in the pattern are set in the flag CYG_FLAG_WAITMODE_OR - return match if any of the conditions in the pattern are set in the flag. CYG_FLAG_WAITMODE_CLR - automatically clear the conditions that caused the calling thread to return a match, IF there was a match. CYG_FLAG_WAITMODE_CLR can be combined with CYG_FLAG_WAITMODE_AND or CYG_FLAG_WAITMODE_OR to clear the bits that caused the condition to be met by oring the bitfields together. If the conditions are met, the pattern that caused the pattern match is returned. A value of 0 will be returned if the thread timed out, was awakened for another reason other than a pattern match or a bad value was specified as the mode. |
| Include: | #include <cyg/kernel/kapi.h> |
| Returns: | the pattern that caused a match or 0 if an error or timeout. |
| See Also: | cyg_flag_setbits, cyg_flag_maskbits, cyg_flag_wait, cyg_flag_poll, cyg_flag_peek, cyg_flag_waiting |
| cyg_flag_poll | |
| Name: | cyg_flag_poll ( ) - test for pattern match but do not block |
|---|---|
| Synopsis: |
cyg_flag_value_t cyg_flag_poll |
| Description: | This causes the calling thread to check if a set of bits (conditions) have been set in a given flag. The "mode" indicates how the pattern will be interpreted:
CYG_FLAG_WAITMODE_AND - return match if all conditions in the pattern are set in the flag CYG_FLAG_WAITMODE_OR - return match if any of the conditions in the pattern are set in the flag. CYG_FLAG_WAITMODE_CLR - automatically clear the conditions that caused the calling thread to return a match, IF there was a match. CYG_FLAG_WAITMODE_CLR can be combined with CYG_FLAG_WAITMODE_AND or CYG_FLAG_WAITMODE_OR to clear the bits that caused the condition to be met by oring the bitfields together. If the conditions are met, the pattern that caused the pattern match is returned. A value of 0 will be returned if the thread timed out, was awakened for another reason other than a pattern match or a bad value was specified as the mode. |
| Include: | #include <cyg/kernel/kapi.h> |
| Returns: | the pattern that caused a match or 0 if there was no match. |
| See Also: | cyg_flag_setbits, cyg_flag_maskbits, cyg_flag_wait, cyg_flag_timed_wait, cyg_flag_peek, cyg_flag_waiting |
| cyg_flag_peek | |
| Name: | cyg_flag_peek ( ) - returns bits (conditions) currently set in a flag |
|---|---|
| Synopsis: |
cyg_flag_value_t cyg_flag_peek |
| Description: | This returns the current bits (conditions) that are set in a given flag. |
| Include: | #include <cyg/kernel/kapi.h> |
| Returns: | the bits (conditions) as a bitmask that have been set in the flag. |
| See Also: | cyg_flag_setbits, cyg_flag_maskbits, cyg_flag_wait, cyg_flag_timed_wait, cyg_flag_poll, cyg_flag_waiting |
|
cyg_flag_waiting |
|
|
Name: |
cyg_flag_waiting ( ) - check to see if threads wait on a given flag |
|---|---|
|
Synopsis: |
cyg_bool_t cyg_flag_waiting( cyg_flag_t *flag /* flag to check */) |
|
Description: |
This reports whether any threads are currently being blocked waiting for bits (conditions) to be set in the given flag. |
|
Include: |
#include <cyg/kernel/kapi.h> |
|
Returns: |
"true" if threads are being blocked, "false" otherwise. |
|
See Also: |
cyg_flag_setbits, cyg_flag_maskbits, cyg_flag_wait, cyg_flag_timed_wait, cyg_flag_poll, cyg_flag_peek |
cyg_flag 系列函数的更多相关文章
- PHP进程通信基础——shmop 、sem系列函数使用
PHP进程通信基础--shmop .sem系列函数使用 进程通信的原理就是在系统中开辟出一个共享区域,不管是管道也好,还是共享内存,都是这个原理.如果心中有了这个概念,就会很方便去理解代码.由于官网上 ...
- PHP 使用 curl_* 系列函数和 curl_multi_* 系列函数进行多接口调用时的性能对比
在页面中调用的服务较多时,使用并行方式,即使用 curl_multi_* 系列函数耗时要小于 curl_* 系列函数. 测试环境 操作系统:Windows x64 Server:Apache PHP: ...
- 第8章 用户模式下的线程同步(1)_Interlocked系列函数
8.1 原子访问:Interlocked系列函数(Interlock英文为互锁的意思) (1)原子访问的原理 ①原子访问:指的是一线程在访问某个资源的同时,能够保证没有其他线程会在同一时刻访问该资源. ...
- PHP ob系列函数详解
一. 相关函数简介: 1.Flush:刷新缓冲区的内容,输出. 函数格式:flush() 说明:这个函数经常使用,效率很高. 2.ob_start :打开输出缓冲区 函数 ...
- Linux中exec()执行文件系列函数的使用说明
函数原型: 描述: exec()系列函数使用新的进程映像替换当前进程映像. 工作方式没有什么差别, 只是参数传递的方式不同罢了. 说明: 1. 这6个函数可分为两大类: execl( ...
- php Output Control 函数 ob_系列函数详解
<?php /* * 输出缓冲控制 * * flush — 刷新输出缓冲 ob_clean — 清空(擦掉)输出缓冲区 ob_end_clean — 清空(擦除)缓冲区并关闭输出缓冲 ob_en ...
- 从简单需求到OLAP的RANK系列函数
同事问了一个非常简单的问题,怎么取出每个partition里面另外一个列的最小值? create table t1 (int c1, int c2); 假如按照c2分区,0-10,10-20,20 ...
- PHP 载入图像 imagecreatefrom_gif_jpeg_png 系列函数
imagecreatefrom 系列函数用于从文件或 URL 载入一幅图像. 载入图像 imagecreatefrom 系列函数用于从文件或 URL 载入一幅图像,成功返回图像资源,失败则返回一个空字 ...
- PHP中ob系列函数整理
ob,输出缓冲区,是output buffering的简称,而不是output cache.ob用对了,是能对速度有一定的帮助,但是盲目的加上ob函数,只会增加CPU额外的负担. 下面我说说ob的基本 ...
随机推荐
- SQL 树结构统计数据
create table #Tmp( ID int IDENTITY (1,1) not null, name varchar(50), sl int); DECLARE @ID VARCHAR(36 ...
- sqlserver 理解文件和文件组
在sqlserver中,数据库在硬盘的存储方式和普通文件存储一样,仅仅几个文件而已,sqlserver通过管理逻辑上的文件组的方式来管理存储数据的文件, 如图: 文件组管理着磁盘上的文件,而文件中存放 ...
- javascript 第28节 jQuery事件、迭代、样式
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 三栏布局的n种实现
本文主要讨论左右边栏固定宽度,中间栏填满其余空间的布局.至于其他类型,基本上也就是半斤和八两.每一种布局都会有个Demo,个人依然认为文章里帖代码并没有Demo来的直接.所以正文负责解释,源码参见De ...
- 在 Eclipse 中使用 JSHint 检查 JavaScript 代码
JSHint Home: http://www.jshint.com/ JSHint Options: http://www.jshint.com/options/ JSHint For Eclips ...
- android 权限总结
1.拨打电话要权限 2.sd目录存东西要权限
- node c/c++扩展模块build失败.
"深入浅出nodejs 朴灵" 例子 c/c++扩展模块 http://diveintonode.org/ 在作者的帮助下,build成功. 下面贴出的hello.cc和bindi ...
- JAVA时钟
效果图如下: //简单动态时钟程序,以图形和数字两种方式来显示当前时间 import javax.swing.*; import java.awt.event.*; import java.awt.* ...
- OpenJudge/Poj 2105 IP Address
1.链接地址: http://poj.org/problem?id=2105 http://bailian.openjudge.cn/practice/2105 2.题目: IP Address Ti ...
- python 自动化之路 day 01 人生若只如初见
本节内容 Python介绍 发展史 Python 2 or 3? 安装 Hello World程序 Python 注释 变量 用户输入 模块初识 .pyc是个什么鬼? 数据类型初识 数据运算 表达式i ...