1 #include <ddekit/ddekit.h>
2 #include <ddekit/printf.h>
3 #include <ddekit/thread.h>
4 #include <ddekit/initcall.h>
13 ddekit_printf("Long Running\n");
14 ddekit_thread_msleep(2000);
20 short_running_thread()
24 ddekit_printf("Short Running\n");
25 ddekit_thread_msleep(500);
30 void ddekit_minix_wait_exit(void); /* import from dde-minix */
43 if (ctx
.uc_mcontext
.mc_magic
!= 0xc0ffee) {
44 printf("FLAG_NONE\n");
47 memset(&ctx
,0,sizeof(ucontext_t
));
48 ctx
.uc_flags
= _UC_IGNSIGM
| _UC_IGNFPU
;
50 if (ctx
.uc_mcontext
.mc_magic
!= 0xc0ffee) {
51 printf("_UC_IGNSIGM | _UC_IGNFPU FAIL\n");
54 memset(&ctx
,0,sizeof(ucontext_t
));
55 ctx
.uc_flags
= _UC_IGNSIGM
;
57 if (ctx
.uc_mcontext
.mc_magic
!= 0xc0ffee) {
58 printf("_UC_IGNSIGM FAIL\n");
61 memset(&ctx
,0,sizeof(ucontext_t
));
62 ctx
.uc_flags
= _UC_IGNFPU
;
64 if (ctx
.uc_mcontext
.mc_magic
!= 0xc0ffee) {
65 printf("_UC_IGNFPU FAIL\n");
70 ddekit_thread_create(long_running_thread
, NULL
, "Long_thread");
71 ddekit_thread_create(short_running_thread
, NULL
, "Short_thread");
72 ddekit_minix_wait_exit();