25
25
#include < stdint.h>
26
26
#include " cmsis_os.h"
27
27
#include " Callback.h"
28
+ #include " toolchain.h"
28
29
29
30
namespace rtos {
30
31
@@ -48,7 +49,16 @@ class Thread {
48
49
@param priority initial priority of the thread function. (default: osPriorityNormal).
49
50
@param stack_size stack size (in bytes) requirements for the thread function. (default: DEFAULT_STACK_SIZE).
50
51
@param stack_pointer pointer to the stack area to be used by this thread (default: NULL).
52
+ @deprecated
53
+ Thread-spawning constructors hide errors and may lead to complex
54
+ program state when a thread is declared.
55
+
56
+ The explicit Thread::start member function should be used to spawn
57
+ a thread.
51
58
*/
59
+ MBED_DEPRECATED (
60
+ " Thread-spawning constructors hide errors and may lead to complex "
61
+ " program state when a thread is declared" )
52
62
Thread (mbed::Callback<void ()> task,
53
63
osPriority priority=osPriorityNormal,
54
64
uint32_t stack_size=DEFAULT_STACK_SIZE,
@@ -63,8 +73,17 @@ class Thread {
63
73
@param priority initial priority of the thread function. (default: osPriorityNormal).
64
74
@param stack_size stack size (in bytes) requirements for the thread function. (default: DEFAULT_STACK_SIZE).
65
75
@param stack_pointer pointer to the stack area to be used by this thread (default: NULL).
76
+ @deprecated
77
+ Thread-spawning constructors hide errors and may lead to complex
78
+ program state when a thread is declared.
79
+
80
+ The explicit Thread::start member function should be used to spawn
81
+ a thread.
66
82
*/
67
83
template <typename T>
84
+ MBED_DEPRECATED (
85
+ " Thread-spawning constructors hide errors and may lead to complex "
86
+ " program state when a thread is declared" )
68
87
Thread (T *obj, void (T::*method)(),
69
88
osPriority priority=osPriorityNormal,
70
89
uint32_t stack_size=DEFAULT_STACK_SIZE,
@@ -80,8 +99,17 @@ class Thread {
80
99
@param priority initial priority of the thread function. (default: osPriorityNormal).
81
100
@param stack_size stack size (in bytes) requirements for the thread function. (default: DEFAULT_STACK_SIZE).
82
101
@param stack_pointer pointer to the stack area to be used by this thread (default: NULL).
102
+ @deprecated
103
+ Thread-spawning constructors hide errors and may lead to complex
104
+ program state when a thread is declared.
105
+
106
+ The explicit Thread::start member function should be used to spawn
107
+ a thread.
83
108
*/
84
109
template <typename T>
110
+ MBED_DEPRECATED (
111
+ " Thread-spawning constructors hide errors and may lead to complex "
112
+ " program state when a thread is declared" )
85
113
Thread (T *obj, void (*method)(T *),
86
114
osPriority priority=osPriorityNormal,
87
115
uint32_t stack_size=DEFAULT_STACK_SIZE,
@@ -97,7 +125,16 @@ class Thread {
97
125
@param priority initial priority of the thread function. (default: osPriorityNormal).
98
126
@param stack_size stack size (in bytes) requirements for the thread function. (default: DEFAULT_STACK_SIZE).
99
127
@param stack_pointer pointer to the stack area to be used by this thread (default: NULL).
128
+ @deprecated
129
+ Thread-spawning constructors hide errors and may lead to complex
130
+ program state when a thread is declared.
131
+
132
+ The explicit Thread::start member function should be used to spawn
133
+ a thread.
100
134
*/
135
+ MBED_DEPRECATED (
136
+ " Thread-spawning constructors hide errors and may lead to complex "
137
+ " program state when a thread is declared" )
101
138
Thread (void (*task)(void const *argument), void *argument=NULL ,
102
139
osPriority priority=osPriorityNormal,
103
140
uint32_t stack_size=DEFAULT_STACK_SIZE,
0 commit comments