Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1605221
  • 博文数量: 695
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 4027
  • 用 户 组: 普通用户
  • 注册时间: 2013-11-20 21:22
文章分类

全部博文(695)

文章存档

2018年(18)

2017年(74)

2016年(170)

2015年(102)

2014年(276)

2013年(55)

发布时间:2014-06-11 20:21:31

int pthread_cond_wait(   pthread_cond_t * restrict cond,   pthread_mutex_t *restrict mutex);这里参数cond是条件变量并且mutex是一个互斥的锁变量,这个锁必须提前被线程锁住.当这个函数被执行,调用的线程被强迫释放唯一的锁,释放了之后,线程被挂起直到信号被唤醒.换醒线程的函数是pthread.........【阅读全文】

阅读(563) | 评论(0) | 转发(0)

发布时间:2014-06-10 15:16:45

对‘pthread_create’未定义的引用由于pthread库不是Linux系统默认的库,连接时需要使用库libpthread.a,所以在使用pthread_create创建线程时,在编译中要加-lpthread参数:gcc -o pthread -lpthread pthread.c......【阅读全文】

阅读(1078) | 评论(0) | 转发(0)

发布时间:2014-05-27 18:56:35

相关函数:longjmp, siglongjmp, setjmp 表头文件:#include <setjmp.h> 函数定义:int sigsetjmp(sigjmp_buf env, int savesigs) 函数说明:sigsetjmp()会保存目前堆栈环境,然后将目前的地址作一个记号,而在程序其他地方调用siglongjmp()时便会直接跳到这个记号位置,然后还原堆栈,继续程序的执行。.........【阅读全文】

阅读(904) | 评论(0) | 转发(0)

发布时间:2014-05-15 14:34:55

......【阅读全文】

阅读(648) | 评论(0) | 转发(0)

发布时间:2014-05-06 15:30:56

本文推荐了一个用于对 C/C++ 程序进行编译和连接以产生可执行程序的通用 Makefile。 在使用 Makefile 之前,只需对它进行一些简单的设置即可;而且一经设置,即使以后对源程序文件有所增减一般也不再需要改动 Makefile。因此,即便是一个没有学习过 Makefile 书写规则.........【阅读全文】

阅读(627) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册