@@ -40,15 +40,15 @@ volatile thread_t *thread_get(kernel_pid_t pid)
40
40
41
41
int thread_getstatus (kernel_pid_t pid )
42
42
{
43
- volatile thread_t * t = thread_get (pid );
44
- return t ? (int )t -> status : (int )STATUS_NOT_FOUND ;
43
+ volatile thread_t * thread = thread_get (pid );
44
+ return thread ? (int )thread -> status : (int )STATUS_NOT_FOUND ;
45
45
}
46
46
47
47
const char * thread_getname (kernel_pid_t pid )
48
48
{
49
49
#ifdef DEVELHELP
50
- volatile thread_t * t = thread_get (pid );
51
- return t ? t -> name : NULL ;
50
+ volatile thread_t * thread = thread_get (pid );
51
+ return thread ? thread -> name : NULL ;
52
52
#else
53
53
(void )pid ;
54
54
return NULL ;
@@ -73,18 +73,18 @@ int thread_wakeup(kernel_pid_t pid)
73
73
74
74
unsigned old_state = irq_disable ();
75
75
76
- thread_t * other_thread = (thread_t * ) thread_get (pid );
76
+ thread_t * thread = (thread_t * ) thread_get (pid );
77
77
78
- if (!other_thread ) {
78
+ if (!thread ) {
79
79
DEBUG ("thread_wakeup: Thread does not exist!\n" );
80
80
}
81
- else if (other_thread -> status == STATUS_SLEEPING ) {
81
+ else if (thread -> status == STATUS_SLEEPING ) {
82
82
DEBUG ("thread_wakeup: Thread is sleeping.\n" );
83
83
84
- sched_set_status (other_thread , STATUS_RUNNING );
84
+ sched_set_status (thread , STATUS_RUNNING );
85
85
86
86
irq_restore (old_state );
87
- sched_switch (other_thread -> priority );
87
+ sched_switch (thread -> priority );
88
88
89
89
return 1 ;
90
90
}
@@ -173,7 +173,7 @@ kernel_pid_t thread_create(char *stack, int stacksize, char priority, int flags,
173
173
DEBUG ("thread_create: stacksize is too small!\n" );
174
174
}
175
175
/* allocate our thread control block at the top of our stackspace */
176
- thread_t * cb = (thread_t * ) (stack + stacksize );
176
+ thread_t * thread = (thread_t * ) (stack + stacksize );
177
177
178
178
#if defined(DEVELHELP ) || defined(SCHED_TEST_STACK )
179
179
if (flags & THREAD_CREATE_STACKTEST ) {
@@ -209,41 +209,41 @@ kernel_pid_t thread_create(char *stack, int stacksize, char priority, int flags,
209
209
return - EOVERFLOW ;
210
210
}
211
211
212
- sched_threads [pid ] = cb ;
212
+ sched_threads [pid ] = thread ;
213
213
214
- cb -> pid = pid ;
215
- cb -> sp = thread_stack_init (function , arg , stack , stacksize );
214
+ thread -> pid = pid ;
215
+ thread -> sp = thread_stack_init (function , arg , stack , stacksize );
216
216
217
217
#if defined(DEVELHELP ) || defined(SCHED_TEST_STACK ) || defined(MODULE_MPU_STACK_GUARD )
218
- cb -> stack_start = stack ;
218
+ thread -> stack_start = stack ;
219
219
#endif
220
220
221
221
#ifdef DEVELHELP
222
- cb -> stack_size = total_stacksize ;
223
- cb -> name = name ;
222
+ thread -> stack_size = total_stacksize ;
223
+ thread -> name = name ;
224
224
#endif
225
225
226
- cb -> priority = priority ;
227
- cb -> status = STATUS_STOPPED ;
226
+ thread -> priority = priority ;
227
+ thread -> status = STATUS_STOPPED ;
228
228
229
- cb -> rq_entry .next = NULL ;
229
+ thread -> rq_entry .next = NULL ;
230
230
231
231
#ifdef MODULE_CORE_MSG
232
- cb -> wait_data = NULL ;
233
- cb -> msg_waiters .next = NULL ;
234
- cib_init (& (cb -> msg_queue ), 0 );
235
- cb -> msg_array = NULL ;
232
+ thread -> wait_data = NULL ;
233
+ thread -> msg_waiters .next = NULL ;
234
+ cib_init (& (thread -> msg_queue ), 0 );
235
+ thread -> msg_array = NULL ;
236
236
#endif
237
237
238
238
sched_num_threads ++ ;
239
239
240
- DEBUG ("Created thread %s. PID: %" PRIkernel_pid ". Priority: %u.\n" , name , cb -> pid , priority );
240
+ DEBUG ("Created thread %s. PID: %" PRIkernel_pid ". Priority: %u.\n" , name , thread -> pid , priority );
241
241
242
242
if (flags & THREAD_CREATE_SLEEPING ) {
243
- sched_set_status (cb , STATUS_SLEEPING );
243
+ sched_set_status (thread , STATUS_SLEEPING );
244
244
}
245
245
else {
246
- sched_set_status (cb , STATUS_PENDING );
246
+ sched_set_status (thread , STATUS_PENDING );
247
247
248
248
if (!(flags & THREAD_CREATE_WOUT_YIELD )) {
249
249
irq_restore (state );
0 commit comments