Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marked thread-spawning constructors as deprecated #2055

Merged
merged 1 commit into from
Jul 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions rtos/rtos/Thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <stdint.h>
#include "cmsis_os.h"
#include "Callback.h"
#include "toolchain.h"

namespace rtos {

Expand All @@ -48,7 +49,16 @@ class Thread {
@param priority initial priority of the thread function. (default: osPriorityNormal).
@param stack_size stack size (in bytes) requirements for the thread function. (default: DEFAULT_STACK_SIZE).
@param stack_pointer pointer to the stack area to be used by this thread (default: NULL).
@deprecated
Thread-spawning constructors hide errors and may lead to complex
program state when a thread is declared.

The explicit Thread::start member function should be used to spawn
a thread.
*/
MBED_DEPRECATED(
"Thread-spawning constructors hide errors and may lead to complex "
"program state when a thread is declared")
Thread(mbed::Callback<void()> task,
osPriority priority=osPriorityNormal,
uint32_t stack_size=DEFAULT_STACK_SIZE,
Expand All @@ -63,8 +73,17 @@ class Thread {
@param priority initial priority of the thread function. (default: osPriorityNormal).
@param stack_size stack size (in bytes) requirements for the thread function. (default: DEFAULT_STACK_SIZE).
@param stack_pointer pointer to the stack area to be used by this thread (default: NULL).
@deprecated
Thread-spawning constructors hide errors and may lead to complex
program state when a thread is declared.

The explicit Thread::start member function should be used to spawn
a thread.
*/
template <typename T>
MBED_DEPRECATED(
"Thread-spawning constructors hide errors and may lead to complex "
"program state when a thread is declared")
Thread(T *obj, void (T::*method)(),
osPriority priority=osPriorityNormal,
uint32_t stack_size=DEFAULT_STACK_SIZE,
Expand All @@ -80,8 +99,17 @@ class Thread {
@param priority initial priority of the thread function. (default: osPriorityNormal).
@param stack_size stack size (in bytes) requirements for the thread function. (default: DEFAULT_STACK_SIZE).
@param stack_pointer pointer to the stack area to be used by this thread (default: NULL).
@deprecated
Thread-spawning constructors hide errors and may lead to complex
program state when a thread is declared.

The explicit Thread::start member function should be used to spawn
a thread.
*/
template <typename T>
MBED_DEPRECATED(
"Thread-spawning constructors hide errors and may lead to complex "
"program state when a thread is declared")
Thread(T *obj, void (*method)(T *),
osPriority priority=osPriorityNormal,
uint32_t stack_size=DEFAULT_STACK_SIZE,
Expand All @@ -97,7 +125,16 @@ class Thread {
@param priority initial priority of the thread function. (default: osPriorityNormal).
@param stack_size stack size (in bytes) requirements for the thread function. (default: DEFAULT_STACK_SIZE).
@param stack_pointer pointer to the stack area to be used by this thread (default: NULL).
@deprecated
Thread-spawning constructors hide errors and may lead to complex
program state when a thread is declared.

The explicit Thread::start member function should be used to spawn
a thread.
*/
MBED_DEPRECATED(
"Thread-spawning constructors hide errors and may lead to complex "
"program state when a thread is declared")
Thread(void (*task)(void const *argument), void *argument=NULL,
osPriority priority=osPriorityNormal,
uint32_t stack_size=DEFAULT_STACK_SIZE,
Expand Down