From: liang_mike Date: Tue, 6 Jan 2009 00:29:04 +0000 (+0000) Subject: Fix a static thread problem on MicaZ by making sure the execution order of ThreadInfo... X-Git-Tag: rc_6_tinyos_2_1_1~537 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=dab673bc2cbf4072f8a3cb0e57e5a1efd93e0324 Fix a static thread problem on MicaZ by making sure the execution order of ThreadInfo.reset[id]() and ThreadScheduler.initThread(id) --- diff --git a/tos/lib/tosthreads/system/StaticThreadP.nc b/tos/lib/tosthreads/system/StaticThreadP.nc index 8b10acbc..f4e1e92c 100644 --- a/tos/lib/tosthreads/system/StaticThreadP.nc +++ b/tos/lib/tosthreads/system/StaticThreadP.nc @@ -50,11 +50,14 @@ module StaticThreadP { implementation { error_t init(uint8_t id, void* arg) { + error_t r1, r2; thread_t* thread_info = call ThreadInfo.get[id](); thread_info->start_arg_ptr = arg; thread_info->mutex_count = 0; thread_info->next_thread = NULL; - return ecombine(call ThreadInfo.reset[id](), call ThreadScheduler.initThread(id)); + r1 = call ThreadInfo.reset[id](); + r2 = call ThreadScheduler.initThread(id); + return ecombine(r1, r2); } command error_t Thread.start[uint8_t id](void* arg) {