1 with Text_IO; use Text_IO;
\r
2 with Basic_Integer_Types;
\r
6 use type Basic_Integer_Types.Unsigned_32;
\r
8 package body Context is
\r
10 Jmp_Buff : aliased Non_Local_Jump.Jmp_Context;
\r
11 pragma Volatile (Jmp_Buff);
\r
13 TCB : System.Address := System.Null_Address;
\r
14 pragma Volatile (TCB);
\r
16 function Pthread_Self return System.Address;
\r
17 pragma Import (C, Pthread_Self, "pthread_self");
\r
19 function Execute_Work(Work : Work_Acc) return Integer is
\r
21 Put_Line ("Start work");
\r
22 TCB := Pthread_Self;
\r
23 Non_Local_Jump.Save_Context(Jmp_Buff'Access);
\r
24 if Non_Local_Jump.After_Jump (Jmp_Buff'Access) = 0 then
\r
25 Put_Line ("---Not After Jump---");
\r
29 Put_Line ("---After Jump---");
\r
34 procedure Restore_Work is
\r
36 Non_Local_Jump.Restore_Context (TCB, Jmp_Buff'Access);
\r