@@ -12,13 +12,13 @@ static inline void ABTD_thread_terminate_sched(ABTI_local *p_local,
1212
1313void ABTD_thread_func_wrapper_thread (void * p_arg )
1414{
15- ABTD_thread_context * p_fctx = (ABTD_thread_context * )p_arg ;
16- void (* thread_func )(void * ) = p_fctx -> f_thread ;
15+ ABTD_thread_context * p_ctx = (ABTD_thread_context * )p_arg ;
16+ void (* thread_func )(void * ) = p_ctx -> f_thread ;
1717
18- thread_func (p_fctx -> p_arg );
18+ thread_func (p_ctx -> p_arg );
1919
2020 /* NOTE: ctx is located in the beginning of ABTI_thread */
21- ABTI_thread * p_thread = (ABTI_thread * )p_fctx ;
21+ ABTI_thread * p_thread = (ABTI_thread * )p_ctx ;
2222#ifndef ABT_CONFIG_DISABLE_STACKABLE_SCHED
2323 ABTI_ASSERT (p_thread -> is_sched == NULL );
2424#endif
@@ -29,13 +29,13 @@ void ABTD_thread_func_wrapper_thread(void *p_arg)
2929
3030void ABTD_thread_func_wrapper_sched (void * p_arg )
3131{
32- ABTD_thread_context * p_fctx = (ABTD_thread_context * )p_arg ;
33- void (* thread_func )(void * ) = p_fctx -> f_thread ;
32+ ABTD_thread_context * p_ctx = (ABTD_thread_context * )p_arg ;
33+ void (* thread_func )(void * ) = p_ctx -> f_thread ;
3434
35- thread_func (p_fctx -> p_arg );
35+ thread_func (p_ctx -> p_arg );
3636
3737 /* NOTE: ctx is located in the beginning of ABTI_thread */
38- ABTI_thread * p_thread = (ABTI_thread * )p_fctx ;
38+ ABTI_thread * p_thread = (ABTI_thread * )p_ctx ;
3939#ifndef ABT_CONFIG_DISABLE_STACKABLE_SCHED
4040 ABTI_ASSERT (p_thread -> is_sched != NULL );
4141#endif
@@ -61,9 +61,9 @@ static inline void ABTDI_thread_terminate(ABTI_local *p_local,
6161 ABTI_thread * p_thread ,
6262 ABT_bool is_sched )
6363{
64- ABTD_thread_context * p_fctx = & p_thread -> ctx ;
64+ ABTD_thread_context * p_ctx = & p_thread -> ctx ;
6565 ABTD_thread_context * p_link = (ABTD_thread_context * )
66- ABTD_atomic_load_ptr ((void * * )& p_fctx -> p_link );
66+ ABTD_atomic_load_ptr ((void * * )& p_ctx -> p_link );
6767 if (p_link ) {
6868 /* If p_link is set, it means that other ULT has called the join. */
6969 ABTI_thread * p_joiner = (ABTI_thread * )p_link ;
@@ -112,15 +112,15 @@ static inline void ABTDI_thread_terminate(ABTI_local *p_local,
112112 * blocked. We have to wake up the joiner ULT. */
113113 do {
114114 p_link = (ABTD_thread_context * )
115- ABTD_atomic_load_ptr ((void * * )& p_fctx -> p_link );
115+ ABTD_atomic_load_ptr ((void * * )& p_ctx -> p_link );
116116 } while (!p_link );
117117 ABTI_thread_set_ready (p_local , (ABTI_thread * )p_link );
118118 }
119119 }
120120
121- /* No other ULT is waiting or blocked for this ULT. Since fcontext does
122- * not switch to other fcontext when it finishes, we need to explicitly
123- * switch to the scheduler. */
121+ /* No other ULT is waiting or blocked for this ULT. Since a context does not
122+ * switch to another context when it finishes, we need to explicitly switch
123+ * to the scheduler. */
124124 ABTI_sched * p_sched ;
125125#ifndef ABT_CONFIG_DISABLE_STACKABLE_SCHED
126126 if (p_thread -> is_sched ) {
@@ -174,21 +174,21 @@ void ABTD_thread_cancel(ABTI_local *p_local, ABTI_thread *p_thread)
174174 * ULT has finished its execution and calls ABTD_thread_terminate/exit,
175175 * this function is called by the scheduler. Therefore, we should not
176176 * context switch to the joiner ULT and need to always wake it up. */
177- ABTD_thread_context * p_fctx = & p_thread -> ctx ;
177+ ABTD_thread_context * p_ctx = & p_thread -> ctx ;
178178
179179 /* acquire load is not needed here. */
180- if (p_fctx -> p_link ) {
180+ if (p_ctx -> p_link ) {
181181 /* If p_link is set, it means that other ULT has called the join. */
182- ABTI_thread * p_joiner = (ABTI_thread * )p_fctx -> p_link ;
182+ ABTI_thread * p_joiner = (ABTI_thread * )p_ctx -> p_link ;
183183 ABTI_thread_set_ready (p_local , p_joiner );
184184 } else {
185185 uint32_t req = ABTD_atomic_fetch_or_uint32 (& p_thread -> request ,
186186 ABTI_THREAD_REQ_JOIN | ABTI_THREAD_REQ_TERMINATE );
187187 if (req & ABTI_THREAD_REQ_JOIN ) {
188188 /* This case means there has been a join request and the joiner has
189189 * blocked. We have to wake up the joiner ULT. */
190- while (ABTD_atomic_load_ptr ((void * * )& p_fctx -> p_link ) == NULL );
191- ABTI_thread * p_joiner = (ABTI_thread * )p_fctx -> p_link ;
190+ while (ABTD_atomic_load_ptr ((void * * )& p_ctx -> p_link ) == NULL );
191+ ABTI_thread * p_joiner = (ABTI_thread * )p_ctx -> p_link ;
192192 ABTI_thread_set_ready (p_local , p_joiner );
193193 }
194194 }
@@ -198,7 +198,7 @@ void ABTD_thread_print_context(ABTI_thread *p_thread, FILE *p_os, int indent)
198198{
199199 char * prefix = ABTU_get_indent_str (indent );
200200 ABTD_thread_context * p_ctx = & p_thread -> ctx ;
201- fprintf (p_os , "%sfctx : %p\n" , prefix , ( void * ) p_ctx -> fctx );
201+ fprintf (p_os , "%sp_ctx : %p\n" , prefix , p_ctx -> p_ctx );
202202 fprintf (p_os , "%sp_arg : %p\n" , prefix , p_ctx -> p_arg );
203203 fprintf (p_os , "%sp_link : %p\n" , prefix , (void * )p_ctx -> p_link );
204204 fflush (p_os );
0 commit comments