CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
来源:互联网 发布:h5多人联网游戏源码 编辑:程序博客网 时间:2024/06/05 22:37
cwe.mitre.org/data/definitions/362.html
Example 2
The following function attempts to acquire a lock in order toperform operations on a shared resource.
(Bad Code)
ExampleLanguage:C
void f(pthread_mutex_t *mutex) {
pthread_mutex_lock(mutex);
/* access shared resource */
pthread_mutex_unlock(mutex);
}
However, the code does not check the value returned bypthread_mutex_lock() for errors. If pthread_mutex_lock() cannot acquirethe mutex for any reason, the function may introduce a race conditioninto the program and result in undefined behavior.
In order to avoid data races, correctly written programs must checkthe result of thread synchronization functions and appropriately handleall errors, either by attempting to recover from them or reporting it tohigher levels.
0 0
- CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
- Concurrent list with condition variable
- CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
- cwe ---Improper Restriction of Excessive Authentication Attempts
- race condition
- java concurrent synchronization
- Asterisk Race Condition Test
- Concurrency and Race Condition
- race condition
- 什么是 Race Condition
- Race Condition(竞争条件)
- concurrent-5-AQS-Condition
- 竞争条件(race condition)
- 什么是静态(race condition)
- race condition 竞态条件
- What is a race condition?
- 竞争条件(race condition)
- 竞争条件(race condition)
- Effective Java——序列化
- 第一篇CSDN日志
- 你得学会并且学得会的Socket编程基础知识
- 自娱自乐--爬虫java实践
- velocity基本的语法
- CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
- 北大百炼1005 I Think I Need a Houseboat题解
- VC6.0实现打开文件与打开文件夹选项
- UVa - 1616 - Caravan Robbers
- 实习收获之软件思想误区的纠正
- 用友ERP T6技术解析(六) 库龄分析
- Oracle 11g启动不了:Out Of Memory
- java选择排序法
- 【Windows编程】系列第三篇:文本字符输出