Skip to content

Commit 7e539a3

Browse files
committed
Multitask Timer implemeted in doubly-linked list
1 parent fcb836f commit 7e539a3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

main.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ int main(void)
1818
}
1919

2020
/* 安装中断信号处理函数 */
21-
if (signal(SIGINT, sigintr_handler) == SIG_ERR)
22-
{
21+
if (signal(SIGINT, sigintr_handler) == SIG_ERR) {
2322
fprintf(stderr, "set SIGINT handler failed.\n");
2423
exit(2);
2524
}
@@ -28,16 +27,14 @@ int main(void)
2827
TimerId_t ids[3];
2928

3029
ids[0] = timer_add(2,say_hello,NULL,LOOP);
31-
if(ids[0] == ADD_FAILED)
32-
{
30+
if(ids[0] == ADD_FAILED) {
3331
fprintf(stderr, "add timer failed.\n");
3432
timer_destroy();
3533
return 2;
3634
}
3735

3836
int value = 555;
3937
ids[1] = timer_add(5, print_value, &value, ONCE);
40-
4138
ids[2] = timer_add(3, print_rectangle, NULL, LOOP);
4239

4340
/* 删除第0个任务 */

0 commit comments

Comments
 (0)