Commit Graph

11 Commits (2f8549aaae7a08c0098cbbac2f2f840cd65ee27c)

Author SHA1 Message Date
Benoît Thébaudeau 81805129f8 mt: Fix preemption
Preemption was supposed to be supported, but it had no means of safely
updating the state of a thread, so mt_exec() could fail to resume a
preempted thread.

mt_exec() is allowed to be called only from the main Contiki thread, so
the mt threads passed to it may be only ready or exited, not running.
Consequently, there is no need for a distinction between the ready and
running states, so merge them as a started state, which avoids having to
update the state of a thread upon preemption.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-11-24 22:30:26 +01:00
Benoît Thébaudeau 927e9b8150 mt: Fix missing call to mtarch_pstop()
If mt_yield() needs it, then mt_exit() too. A thread could indeed be
preempted while calling mt_exit().

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2016-11-24 22:30:26 +01:00
marcas756 b787b27d5b Moved thread states from module to header 2014-11-22 15:49:45 +01:00
Adam Dunkels 944537fccf Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
nvt-se a21dece53f removed unused state codes and unused printf statements 2009-09-03 12:57:57 +00:00
adamdunkels ef4b12437b Removed unused code 2007-05-22 20:58:14 +00:00
oliverschmidt 1d63347cfc Added mt_stop() calling mtarch_stop() to allow for thread resource cleanup. 2007-04-03 18:47:21 +00:00
adamdunkels 786d0d1892 Copyright update 2007-03-15 21:46:07 +00:00
adamdunkels 1504f2836e Commented out unused functionality: the ability to create a process running a thread was never used. With the new code, only running 'bare' threads is supported. If support for creating processes with a thread is needed, it may be reneabled later but currently there doesn't seem to be a need for it 2006-09-26 20:59:51 +00:00
adamdunkels ea13dd9179 #if 0:ed out unused code 2006-09-01 22:56:47 +00:00
adamdunkels c9e808d638 Import of the contiki-2.x development code from the SICS internal CVS server 2006-06-17 22:41:10 +00:00