
linux c
文章平均质量分 65
johnsonchengwu
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
linux条件下打印错误编码
linux打印系统输出错误消息,linux系统内错误消息有133个,通过以下函数打印出来函数名称error_list.c#include #include #include #define ERRNO 133int main() { int i; for (i = 0; i < ERRNO; i++) { printf("%d %s\n",原创 2013-01-08 01:09:15 · 1026 阅读 · 0 评论 -
linux c使用互斥锁实现同步
1. 需要使用到的库pthread.h2. 需要使用到的函数有pthread_mutex_init, pthread_mutex_destory, pthread_mutex_lock, pthread_unlock,3. 需要保护的数据结构为typedef struct cnt_sum { int cnt; pthread_mutex_t _mutex;} cnt_su原创 2013-10-09 13:09:07 · 834 阅读 · 0 评论 -
linux c 线程设置detached状态
1. 需要用到的库pthread_createpthread_attr_initpthread_attr_destorypthread_attr_setdetachstate各个函数具体的用法可以查询google了解2. 线程的分离状态和表述在任何一个时间点上,线程是可结合的(joinable),或者是分离的(detached)。一个可结合的线程能够被其他线程收回其原创 2013-10-10 12:50:27 · 2902 阅读 · 0 评论 -
linux c pthread_mutex_lock和pthread_mutex_trylock对比
1. 需要用到的函数pthread_mutex_lockphtread_mutex_trylockpthread_mutex_unlock原创 2013-10-10 13:14:54 · 2625 阅读 · 1 评论 -
c++实现List数据结构
1. 节点数据结构为:struct Node { void *data; Node *next; } *head;2. list操作函数:bool add(void*);bool del(void*);bool insert(void*, void*);void traver原创 2013-10-14 12:40:54 · 855 阅读 · 0 评论