RIOT-OS/RIOT — pull request #856 by Kijewski (2014-03-04 20:02:07+00:00)
Title:  core: add an argument to `thread_create()` (implementation)

See discussion in #847. This PR adds a parameter to `thread_create()` that is passed to the entry function.

I implemented the additional argument for native and ARM boards. Tested with `test_thread_cooperation` on native and msba2.

I did not look into how to fix msp430-common's `thread_stack_init()`, because I don't have a board to test with, anyway. I guess all you have to do is set the last "saved" register in [cpu.c#L78][1] to `arg`.

----

Right now this adds a new function instead of changing the current one. The sole reason for that is not to break the current tests. After we have confirmed that the change does work we can work on updating the tests and examples.

I would be happy to see PRs to my branch from kind people that want to help me fix the current examples and tests. :heart: -- That is if the discussion shows a consent on @kaspar030's suggestion to change the core function and don't use a legacy wrapper.

[1]: https://github.com/RIOT-OS/RIOT/blob/master/cpu/msp430-common/cpu.c#L78