pthread issue in program
来源:互联网 发布:arm linux qt 编辑:程序博客网 时间:2024/06/06 01:11
I meet one pthread issue today. After the condition signal, another thread which was waiting for the signal didn't wake up. While the same code works well in x86, but it can't work in one mipsel product.
The issue was found after changed some other pthread issues. But it found that the program was unstable. Even one struct name can affect the result!
The root cause was wrong use mutex in condition. Here is the code episode (glib code):
GMutex *mutex = g_mutex_new();
........
if (!g_cond_timewait(cond, mutex, time))
obviously, it lacks the g_mutex_lock(). We know, the g_cond_timewait() will call g_mutex_unlock(pthread_unlock), which is undefined result in some enviroment.
- pthread issue in program
- Program source---pthread
- YUM issue in F11_64
- issue in Emacs24
- pthread in c++
- Using pthread in Android
- Import Spreadsheet issue in Sharepoint
- Some issue in my Interiew
- path in java program
- the message in program
- Encoding in Java program
- stray '/' in program 错误
- stray '/161' in program
- stray in program
- stray '\161' in program
- stray'\241'in program
- Practice in program
- stray '\241' in program
- signal SIGCHLD
- Visual Studio 2010 IDE中的新功能(1)
- Visual Studio 2010 IDE中的新功能(2)
- MP3 and AAC standard
- 理解思想比知道实现细节更重要
- pthread issue in program
- flash的Socket连接,服务端用没有平台限制
- PHP面向对象分析设计的61条军规
- 传智播客JAVA培训20100611面试二
- POJ_1013_Counterfeit Dollar
- 数据库类
- “俄罗斯套娃问题”程序(能够处理稀疏矩阵)
- 【转】PDF转换Word 方法盘点--附个人实践点评
- 利用word将PDF转换DOC文件的方法