ChinaUnix.net
相关文章推荐:

线程退出 cleanup atexit

某教材有如下示例程序: void cleanup(void *arg) { ...略 ... } void * tfn1(void * arg) { int a = 1; printf("the 1st thread\n"); pthread_cleanup_push(cleanup,&a); a = 2; pthread_cleanup_push(cleanup,&a); return NULL; pthread_cleanup_pop(0); pthread_cleanup_pop(0); return NULL; } int main()\ { ... pthread_create(&tid,NULL,tfn1,NULL); 略...

by banbi1985 - Linux环境编程 - 2011-12-28 12:19:31 阅读(1195) 回复(4)

相关讨论

atexit函数有什么用啊?

by kellenforever - C/C++ - 2010-11-02 13:37:47 阅读(3601) 回复(7)

哪位大侠帮忙解释下 atexit()函数是在main()结束前执行呢还是在结束之后执行呢???

by 单眼皮大姐 - C/C++ - 2010-07-07 18:11:20 阅读(6424) 回复(12)

1、函数原型int atexit( void (__cdecl *func )( void )); 2、功能:注册程序正常终止时要被调用的函数#include #include void exit_fn1(void) { printf("Exit function #1 called\n"); } void exit_fn2(int a) { printf("Exit function #2 called, a = %d\n",a); } int main(void) { /* post exit function #1 */ atexit(exit_fn1); /* post exit function #2 */ atexit(exit_fn2(2)); re...

by tancotq - Linux文档专区 - 2009-10-06 13:14:54 阅读(872) 回复(0)

想问一下,cleanup的时间和甚么有关,硬盘的增长和cleanup时间的长短有甚么直接的联系,是不是和cleanup的设置相关。望解答,谢谢。

by tamashii - AS400 - 2007-09-03 11:06:22 阅读(2030) 回复(1)

atexit的参数是一个函数指针, 参数函数无需任何参数和返回. void fun1() { printf("fun1() done!!!\n"); } int fun2(int i) { printf("fun2() done!!! %d\n", i); return i+2; } int main(void) { printf("Main Start!!!!\n"); atexit(fun1); atexit(fun2(2)); /* 当不给参数时, 两个函数都可以正常执行*/ printf("Main End!!!!\n"); exit(0); } 下面是执行...

by Mao_jzh - C/C++ - 2006-03-23 19:40:03 阅读(2421) 回复(2)

2010-5-17 8:00:06 - Info bpdbm(pid=4288) image catalog cleanup 2010-5-17 8:00:06 - Info bpdbm(pid=4288) deleting images which expire before Mon May 17 08:00:06 2010 (1274054406) 2010-5-17 8:00:06 - Info bpdbm(pid=4288) processing client aqx 2010-5-17 8:00:06 - Info bpdbm(pid=4288) processing client backupserver 2010-5-17 8:00:06 - Info bpdbm(pid=4288) processing cli...

by octopus1908 - 存储备份 - 2010-05-17 11:20:30 阅读(2278) 回复(2)

为什么这么说呢? 卸载deb包时候,可以连不要的依赖关系包一起删除,但是多如牛毛的rpm却不可以。 这个真的是rpm的痛! yum仅仅能在线安装rpm,但是只能在安装的时候解决依赖关系,卸载的时候却不行。 不过,有个工具可以专门解决rpm依赖关系:package-cleanup Options: -h, --help show this help message and exit --problems List dependency problems in the local RPM database --leaves ...

by 我要用linux - Linux文档专区 - 2008-03-05 22:06:01 阅读(1091) 回复(0)

1.shutdown the SF6800 steps 1)telnet the OS hosts (domain a),execute: #init 5 2)connect the serial console witch SC0 3)Type 1 into the domain System Controller 'USF6800': Type 0 for Platform Shell Type 1 for domain A console Type 2 for domain B console Type 3 for domain C console Type 4 for domain D console Input: 1 -- Type 1 for domain A console ...

by Gavin_Peng - Solaris文档中心 - 2007-10-29 21:20:09 阅读(845) 回复(0)

C++ introduced the concept of a constructor, a special method automatically called when an objects is created. Java also adopted the constructor, an in additon has a garbage collector that automatically releases memory resources when they're no longer being used. Guaranteed initialization with the constructor In Java, the class designer can guarantee initialization of ...

by Kingway886 - Java文档中心 - 2006-07-17 09:14:08 阅读(957) 回复(0)

\r\nI have a AIX RS/6000 server which has a Logical Volumn is nearly 100% full. The mount point is /var and the lv is /dev/hd9var\r\n\r\nWhat I think is maybe there are too much log files there. But I don\'t know which files can be deleted to free up space.\r\n\r\nThanks.

by kew888 - AIX - 2002-07-05 10:28:40 阅读(3054) 回复(4)