1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
============================================================================
Name : task-exit.c
Author : Heiher <r@hev.cc>
Copyright : Copyright (c) 2018 everyone.
Description : Task Exit Test
============================================================================
*/
#include <stddef.h>
#include <assert.h>
#include <hev-task.h>
#include <hev-task-system.h>
static void
task_entry (void *data)
{
hev_task_exit ();
assert (0);
}
int
main (int argc, char *argv[])
{
HevTask *task;
assert (hev_task_system_init () == 0);
task = hev_task_new (-1);
assert (task);
hev_task_run (task, task_entry, NULL);
hev_task_system_run ();
hev_task_system_fini ();
return 0;
}