简体   繁体   English

使用SIGALRM的C中的计时器线程

[英]timer thread in c using SIGALRM

I'm a newbie. 我是新手。 I need to implement a timer thread in C. On timeout it must go to another thread/function to perform some activity. 我需要在C中实现一个计时器线程。超时后,它必须转到另一个线程/函数来执行一些活动。 Can anyone help me for implementing it with SIGALRM? 谁能帮我实现SIGALRM? Would be good if anyone can leave some examples here. 如果有人可以在这里留下一些例子,那就太好了。

dude ,i dont think anyone will be helping u,without u producing some codes.. anyhow as part of tutorial heres link ..read it.. 伙计,我认为没有人会帮助您,而您不会产生一些代码..无论如何,作为教程的一部分,这里链接..阅读它。

pls

http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_timer.html http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_timer.html

signal(SIGALRM, TR69_DM_SignalHandler); alarm(PassedFromCaller->TimeOut); pause();

I found this working.. But is there any way I can avoid a pause statement?? 我发现这个工作正常。但是有什么办法可以避免我的暂停声明? I want my thread to continue with its work. 我希望我的线程继续其工作。 Should I make the alarm alone in another thread? 我应该在另一个线程中单独发出警报吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM