diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2022-02-07 08:56:39 +0100 |
---|---|---|
committer | Benoit Germain <bnt.germain@gmail.com> | 2022-02-07 08:56:39 +0100 |
commit | 621fb024b5f887ef9e81e2f28bf087386f5300e1 (patch) | |
tree | 3ed681e2db07a0516904b2cda4e7144c714d19e0 /src/lanes_private.h | |
parent | 00c84df3adc0b295ef20bc35bc8df9632e3b93e7 (diff) | |
download | lanes-621fb024b5f887ef9e81e2f28bf087386f5300e1.tar.gz lanes-621fb024b5f887ef9e81e2f28bf087386f5300e1.tar.bz2 lanes-621fb024b5f887ef9e81e2f28bf087386f5300e1.zip |
Changed all indentations to all whitespaces
Tabs mess up alignment of stack contents comments, so I'm done with them.
Diffstat (limited to 'src/lanes_private.h')
-rw-r--r-- | src/lanes_private.h | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/src/lanes_private.h b/src/lanes_private.h index 1a15969..7da3286 100644 --- a/src/lanes_private.h +++ b/src/lanes_private.h | |||
@@ -9,65 +9,65 @@ | |||
9 | // | 9 | // |
10 | struct s_Lane | 10 | struct s_Lane |
11 | { | 11 | { |
12 | THREAD_T thread; | 12 | THREAD_T thread; |
13 | // | 13 | // |
14 | // M: sub-thread OS thread | 14 | // M: sub-thread OS thread |
15 | // S: not used | 15 | // S: not used |
16 | 16 | ||
17 | char const* debug_name; | 17 | char const* debug_name; |
18 | 18 | ||
19 | lua_State* L; | 19 | lua_State* L; |
20 | Universe* U; | 20 | Universe* U; |
21 | // | 21 | // |
22 | // M: prepares the state, and reads results | 22 | // M: prepares the state, and reads results |
23 | // S: while S is running, M must keep out of modifying the state | 23 | // S: while S is running, M must keep out of modifying the state |
24 | 24 | ||
25 | volatile enum e_status status; | 25 | volatile enum e_status status; |
26 | // | 26 | // |
27 | // M: sets to PENDING (before launching) | 27 | // M: sets to PENDING (before launching) |
28 | // S: updates -> RUNNING/WAITING -> DONE/ERROR_ST/CANCELLED | 28 | // S: updates -> RUNNING/WAITING -> DONE/ERROR_ST/CANCELLED |
29 | 29 | ||
30 | SIGNAL_T* volatile waiting_on; | 30 | SIGNAL_T* volatile waiting_on; |
31 | // | 31 | // |
32 | // When status is WAITING, points on the linda's signal the thread waits on, else NULL | 32 | // When status is WAITING, points on the linda's signal the thread waits on, else NULL |
33 | 33 | ||
34 | volatile enum e_cancel_request cancel_request; | 34 | volatile enum e_cancel_request cancel_request; |
35 | // | 35 | // |
36 | // M: sets to FALSE, flags TRUE for cancel request | 36 | // M: sets to FALSE, flags TRUE for cancel request |
37 | // S: reads to see if cancel is requested | 37 | // S: reads to see if cancel is requested |
38 | 38 | ||
39 | #if THREADWAIT_METHOD == THREADWAIT_CONDVAR | 39 | #if THREADWAIT_METHOD == THREADWAIT_CONDVAR |
40 | SIGNAL_T done_signal; | 40 | SIGNAL_T done_signal; |
41 | // | 41 | // |
42 | // M: Waited upon at lane ending (if Posix with no PTHREAD_TIMEDJOIN) | 42 | // M: Waited upon at lane ending (if Posix with no PTHREAD_TIMEDJOIN) |
43 | // S: sets the signal once cancellation is noticed (avoids a kill) | 43 | // S: sets the signal once cancellation is noticed (avoids a kill) |
44 | 44 | ||
45 | MUTEX_T done_lock; | 45 | MUTEX_T done_lock; |
46 | // | 46 | // |
47 | // Lock required by 'done_signal' condition variable, protecting | 47 | // Lock required by 'done_signal' condition variable, protecting |
48 | // lane status changes to DONE/ERROR_ST/CANCELLED. | 48 | // lane status changes to DONE/ERROR_ST/CANCELLED. |
49 | #endif // THREADWAIT_METHOD == THREADWAIT_CONDVAR | 49 | #endif // THREADWAIT_METHOD == THREADWAIT_CONDVAR |
50 | 50 | ||
51 | volatile enum | 51 | volatile enum |
52 | { | 52 | { |
53 | NORMAL, // normal master side state | 53 | NORMAL, // normal master side state |
54 | KILLED // issued an OS kill | 54 | KILLED // issued an OS kill |
55 | } mstatus; | 55 | } mstatus; |
56 | // | 56 | // |
57 | // M: sets to NORMAL, if issued a kill changes to KILLED | 57 | // M: sets to NORMAL, if issued a kill changes to KILLED |
58 | // S: not used | 58 | // S: not used |
59 | 59 | ||
60 | struct s_Lane* volatile selfdestruct_next; | 60 | struct s_Lane* volatile selfdestruct_next; |
61 | // | 61 | // |
62 | // M: sets to non-NULL if facing lane handle '__gc' cycle but the lane | 62 | // M: sets to non-NULL if facing lane handle '__gc' cycle but the lane |
63 | // is still running | 63 | // is still running |
64 | // S: cleans up after itself if non-NULL at lane exit | 64 | // S: cleans up after itself if non-NULL at lane exit |
65 | 65 | ||
66 | #if HAVE_LANE_TRACKING | 66 | #if HAVE_LANE_TRACKING |
67 | struct s_Lane* volatile tracking_next; | 67 | struct s_Lane* volatile tracking_next; |
68 | #endif // HAVE_LANE_TRACKING | 68 | #endif // HAVE_LANE_TRACKING |
69 | // | 69 | // |
70 | // For tracking only | 70 | // For tracking only |
71 | }; | 71 | }; |
72 | typedef struct s_Lane Lane; | 72 | typedef struct s_Lane Lane; |
73 | 73 | ||
@@ -79,14 +79,14 @@ typedef struct s_Lane Lane; | |||
79 | 79 | ||
80 | static inline Lane* get_lane_from_registry( lua_State* L) | 80 | static inline Lane* get_lane_from_registry( lua_State* L) |
81 | { | 81 | { |
82 | Lane* s; | 82 | Lane* s; |
83 | STACK_GROW( L, 1); | 83 | STACK_GROW( L, 1); |
84 | STACK_CHECK( L, 0); | 84 | STACK_CHECK( L, 0); |
85 | REGISTRY_GET( L, CANCEL_TEST_KEY); | 85 | REGISTRY_GET( L, CANCEL_TEST_KEY); |
86 | s = lua_touserdata( L, -1); // lightuserdata (true 's_lane' pointer) / nil | 86 | s = lua_touserdata( L, -1); // lightuserdata (true 's_lane' pointer) / nil |
87 | lua_pop( L, 1); | 87 | lua_pop( L, 1); |
88 | STACK_END( L, 0); | 88 | STACK_END( L, 0); |
89 | return s; | 89 | return s; |
90 | } | 90 | } |
91 | 91 | ||
92 | int push_thread_status( lua_State* L, Lane* s); | 92 | int push_thread_status( lua_State* L, Lane* s); |