s******n 发帖数: 2 | 1 I met a problem when I tried to set up a timer. The program
will stop
after some time and shows "Alarm clock". Who knows or meets
the problem?
Or could you show me your timer?
Thank you!
f*****[email protected] |
m*****e 发帖数: 4193 | 2 use signals
SIGALRM or sth
【在 s******n 的大作中提到】 : I met a problem when I tried to set up a timer. The program : will stop : after some time and shows "Alarm clock". Who knows or meets : the problem? : Or could you show me your timer? : Thank you! : f*****[email protected]
|
s******n 发帖数: 2 | 3 Yes, I used SIGALRM, but sometimes the program will stop and
it gives
a "Alarm clock" message.
I do not know why.
Thank you!
【在 m*****e 的大作中提到】 : use signals : SIGALRM or sth
|
m*****e 发帖数: 4193 | 4 check any Unix programming book about this. You can not do much in a
signal handler. Unix sucks on this. Probably using a thread is better.
Don't ask me, I am not en expert on programming threads in C.
【在 s******n 的大作中提到】 : Yes, I used SIGALRM, but sometimes the program will stop and : it gives : a "Alarm clock" message. : I do not know why. : Thank you!
|