diff options
Diffstat (limited to 'src/lanes_private.h')
-rw-r--r-- | src/lanes_private.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/lanes_private.h b/src/lanes_private.h index 6717fe0..67c99f7 100644 --- a/src/lanes_private.h +++ b/src/lanes_private.h | |||
@@ -1,10 +1,15 @@ | |||
1 | #if !defined __lanes_private_h__ | 1 | #pragma once |
2 | #define __lanes_private_h__ 1 | ||
3 | 2 | ||
4 | #include "uniquekey.h" | 3 | #include "uniquekey.h" |
5 | #include "cancel.h" | 4 | #include "cancel.h" |
6 | #include "universe.h" | 5 | #include "universe.h" |
7 | 6 | ||
7 | enum ThreadStatus | ||
8 | { | ||
9 | NORMAL, // normal master side state | ||
10 | KILLED // issued an OS kill | ||
11 | }; | ||
12 | |||
8 | // NOTE: values to be changed by either thread, during execution, without | 13 | // NOTE: values to be changed by either thread, during execution, without |
9 | // locking, are marked "volatile" | 14 | // locking, are marked "volatile" |
10 | // | 15 | // |
@@ -49,11 +54,7 @@ struct s_Lane | |||
49 | // lane status changes to DONE/ERROR_ST/CANCELLED. | 54 | // lane status changes to DONE/ERROR_ST/CANCELLED. |
50 | #endif // THREADWAIT_METHOD == THREADWAIT_CONDVAR | 55 | #endif // THREADWAIT_METHOD == THREADWAIT_CONDVAR |
51 | 56 | ||
52 | volatile enum | 57 | volatile enum ThreadStatus mstatus; |
53 | { | ||
54 | NORMAL, // normal master side state | ||
55 | KILLED // issued an OS kill | ||
56 | } mstatus; | ||
57 | // | 58 | // |
58 | // M: sets to NORMAL, if issued a kill changes to KILLED | 59 | // M: sets to NORMAL, if issued a kill changes to KILLED |
59 | // S: not used | 60 | // S: not used |
@@ -84,13 +85,10 @@ static inline Lane* get_lane_from_registry( lua_State* L) | |||
84 | STACK_GROW( L, 1); | 85 | STACK_GROW( L, 1); |
85 | STACK_CHECK( L, 0); | 86 | STACK_CHECK( L, 0); |
86 | REGISTRY_GET( L, CANCEL_TEST_KEY); | 87 | REGISTRY_GET( L, CANCEL_TEST_KEY); |
87 | s = lua_touserdata( L, -1); // lightuserdata (true 's_lane' pointer) / nil | 88 | s = (Lane*) lua_touserdata( L, -1); // lightuserdata (true 's_lane' pointer) / nil |
88 | lua_pop( L, 1); | 89 | lua_pop( L, 1); |
89 | STACK_END( L, 0); | 90 | STACK_END( L, 0); |
90 | return s; | 91 | return s; |
91 | } | 92 | } |
92 | 93 | ||
93 | int push_thread_status( lua_State* L, Lane* s); | 94 | int push_thread_status( lua_State* L, Lane* s); |
94 | |||
95 | |||
96 | #endif // __lanes_private_h__ \ No newline at end of file | ||