Skip to content

Commit a0197db

Browse files
committedJan 8, 2020
Thread: remove methods deprecated in 5.10
1 parent d23db1a commit a0197db

File tree

3 files changed

+0
-200
lines changed

3 files changed

+0
-200
lines changed
 

‎UNITTESTS/stubs/Thread_stub.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ using namespace rtos;
2121

2222
osStatus Thread_stub::osStatus_value = osOK;
2323

24-
osStatus Thread::wait_until(uint64_t millisec)
25-
{
26-
return 0;
27-
}
28-
2924
osStatus Thread::terminate()
3025
{
3126
return 0;

‎rtos/Thread.h

-119
Original file line numberDiff line numberDiff line change
@@ -171,19 +171,6 @@ class Thread : private mbed::NonCopyable<Thread> {
171171
*/
172172
uint32_t flags_set(uint32_t flags);
173173

174-
/** Set the specified Thread Flags for the thread.
175-
@param signals specifies the signal flags of the thread that should be set.
176-
@return signal flags after setting or osFlagsError in case of incorrect parameters.
177-
178-
@note You may call this function from ISR context.
179-
@deprecated Other signal_xxx methods have been deprecated in favour of ThisThread::flags functions.
180-
To match this naming scheme, derived from CMSIS-RTOS2, Thread::flags_set is now provided.
181-
*/
182-
MBED_DEPRECATED_SINCE("mbed-os-5.10",
183-
"Other signal_xxx methods have been deprecated in favour of ThisThread::flags functions. "
184-
"To match this naming scheme, derived from CMSIS-RTOS2, Thread::flags_set is now provided.")
185-
int32_t signal_set(int32_t signals);
186-
187174
/** State of the Thread */
188175
enum State {
189176
Inactive, /**< NOT USED */
@@ -256,112 +243,6 @@ class Thread : private mbed::NonCopyable<Thread> {
256243
*/
257244
osThreadId_t get_id() const;
258245

259-
/** Clears the specified Thread Flags of the currently running thread.
260-
@param signals specifies the signal flags of the thread that should be cleared.
261-
@return signal flags before clearing or osFlagsError in case of incorrect parameters.
262-
263-
@note You cannot call this function from ISR context.
264-
@deprecated Static methods only affecting current thread cause confusion. Replaced by ThisThread::flags_clear.
265-
*/
266-
MBED_DEPRECATED_SINCE("mbed-os-5.10",
267-
"Static methods only affecting current thread cause confusion. "
268-
"Replaced by ThisThread::flags_clear.")
269-
static int32_t signal_clr(int32_t signals);
270-
271-
/** Wait for one or more Thread Flags to become signaled for the current RUNNING thread.
272-
@param signals wait until all specified signal flags are set or 0 for any single signal flag.
273-
@param millisec timeout value. (default: osWaitForever).
274-
@return event flag information or error code. @note if @a millisec is set to 0 and flag is no set the event carries osOK value.
275-
276-
@note You cannot call this function from ISR context.
277-
@deprecated Static methods only affecting current thread cause confusion.
278-
Replaced by ThisThread::flags_wait_all, ThisThread::flags_wait_all_for, ThisThread::flags_wait_any and ThisThread:wait_any_for.
279-
*/
280-
MBED_DEPRECATED_SINCE("mbed-os-5.10",
281-
"Static methods only affecting current thread cause confusion. "
282-
"Replaced by ThisThread::flags_wait_all, ThisThread::flags_wait_all_for, ThisThread::flags_wait_any and ThisThread:wait_any_for.")
283-
static osEvent signal_wait(int32_t signals, uint32_t millisec = osWaitForever);
284-
285-
/** Wait for a specified time period in milliseconds
286-
Being tick-based, the delay will be up to the specified time - eg for
287-
a value of 1 the system waits until the next millisecond tick occurs,
288-
leading to a delay of 0-1 milliseconds.
289-
@param millisec time delay value
290-
@return status code that indicates the execution status of the function.
291-
292-
@note You cannot call this function from ISR context.
293-
@deprecated Static methods only affecting current thread cause confusion. Replaced by ThisThread::sleep_for.
294-
*/
295-
MBED_DEPRECATED_SINCE("mbed-os-5.10",
296-
"Static methods only affecting current thread cause confusion. "
297-
"Replaced by ThisThread::sleep_for.")
298-
static osStatus wait(uint32_t millisec);
299-
300-
/** Wait until a specified time in millisec
301-
The specified time is according to Kernel::get_ms_count().
302-
@param millisec absolute time in millisec
303-
@return status code that indicates the execution status of the function.
304-
@note not callable from interrupt
305-
@note if millisec is equal to or lower than the current tick count, this
306-
returns immediately, either with an error or "osOK".
307-
@note the underlying RTOS may have a limit to the maximum wait time
308-
due to internal 32-bit computations, but this is guaranteed to work if the
309-
delay is <= 0x7fffffff milliseconds (~24 days). If the limit is exceeded,
310-
it may return with an immediate error, or wait for the maximum delay.
311-
312-
@note You cannot call this function from ISR context.
313-
@deprecated Static methods only affecting current thread cause confusion. Replaced by ThisThread::sleep_until.
314-
*/
315-
MBED_DEPRECATED_SINCE("mbed-os-5.10",
316-
"Static methods only affecting current thread cause confusion. "
317-
"Replaced by ThisThread::sleep_until.")
318-
static osStatus wait_until(uint64_t millisec);
319-
320-
/** Pass control to next thread that is in state READY.
321-
@return status code that indicates the execution status of the function.
322-
323-
@note You cannot call this function from ISR context.
324-
@deprecated Static methods only affecting current thread cause confusion. Replaced by ThisThread::sleep_until.
325-
*/
326-
MBED_DEPRECATED_SINCE("mbed-os-5.10",
327-
"Static methods only affecting current thread cause confusion. "
328-
"Replaced by ThisThread::yield.")
329-
static osStatus yield();
330-
331-
/** Get the thread id of the current running thread.
332-
@return thread ID for reference by other functions or nullptr in case of error.
333-
334-
@note You may call this function from ISR context.
335-
@deprecated Static methods only affecting current thread cause confusion. Replaced by ThisThread::get_id.
336-
Use Thread::get_id for the ID of a specific Thread.
337-
*/
338-
MBED_DEPRECATED_SINCE("mbed-os-5.10",
339-
"Static methods only affecting current thread cause confusion. "
340-
"Replaced by ThisThread::get_id. Use Thread::get_id for the ID of a specific Thread.")
341-
static osThreadId gettid();
342-
343-
/** Attach a function to be called by the RTOS idle task
344-
@param fptr pointer to the function to be called
345-
346-
@note You may call this function from ISR context.
347-
@deprecated Static methods affecting system cause confusion. Replaced by Kernel::attach_idle_hook.
348-
*/
349-
MBED_DEPRECATED_SINCE("mbed-os-5.10",
350-
"Static methods affecting system cause confusion. "
351-
"Replaced by Kernel::attach_idle_hook.")
352-
static void attach_idle_hook(void (*fptr)(void));
353-
354-
/** Attach a function to be called when a task is killed
355-
@param fptr pointer to the function to be called
356-
357-
@note You may call this function from ISR context.
358-
@deprecated Static methods affecting system cause confusion. Replaced by Kernel::attach_thread_terminate_hook.
359-
*/
360-
MBED_DEPRECATED_SINCE("mbed-os-5.10",
361-
"Static methods affecting system cause confusion. "
362-
"Replaced by Kernel::attach_thread_terminate_hook.")
363-
static void attach_terminate_hook(void (*fptr)(osThreadId id));
364-
365246
/** Thread destructor
366247
*
367248
* @note You cannot call this function from ISR context.

‎rtos/source/Thread.cpp

-76
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,6 @@ uint32_t Thread::flags_set(uint32_t flags)
175175
return flags;
176176
}
177177

178-
int32_t Thread::signal_set(int32_t flags)
179-
{
180-
return osThreadFlagsSet(_tid, flags);
181-
}
182-
183178
Thread::State Thread::get_state() const
184179
{
185180
uint8_t state = osThreadTerminated;
@@ -323,77 +318,6 @@ osThreadId_t Thread::get_id() const
323318
return _tid;
324319
}
325320

326-
int32_t Thread::signal_clr(int32_t flags)
327-
{
328-
return osThreadFlagsClear(flags);
329-
}
330-
331-
osEvent Thread::signal_wait(int32_t signals, uint32_t millisec)
332-
{
333-
uint32_t res;
334-
osEvent evt;
335-
uint32_t options = osFlagsWaitAll;
336-
if (signals == 0) {
337-
options = osFlagsWaitAny;
338-
signals = 0x7FFFFFFF;
339-
}
340-
res = osThreadFlagsWait(signals, options, millisec);
341-
if (res & osFlagsError) {
342-
switch (res) {
343-
case osFlagsErrorISR:
344-
evt.status = osErrorISR;
345-
break;
346-
case osFlagsErrorResource:
347-
evt.status = osOK;
348-
break;
349-
case osFlagsErrorTimeout:
350-
evt.status = (osStatus)osEventTimeout;
351-
break;
352-
case osFlagsErrorParameter:
353-
default:
354-
evt.status = (osStatus)osErrorValue;
355-
break;
356-
}
357-
} else {
358-
evt.status = (osStatus)osEventSignal;
359-
evt.value.signals = res;
360-
}
361-
362-
return evt;
363-
}
364-
365-
osStatus Thread::wait(uint32_t millisec)
366-
{
367-
ThisThread::sleep_for(millisec);
368-
return osOK;
369-
}
370-
371-
osStatus Thread::wait_until(uint64_t millisec)
372-
{
373-
ThisThread::sleep_until(millisec);
374-
return osOK;
375-
}
376-
377-
osStatus Thread::yield()
378-
{
379-
return osThreadYield();
380-
}
381-
382-
osThreadId Thread::gettid()
383-
{
384-
return osThreadGetId();
385-
}
386-
387-
void Thread::attach_idle_hook(void (*fptr)(void))
388-
{
389-
rtos_attach_idle_hook(fptr);
390-
}
391-
392-
void Thread::attach_terminate_hook(void (*fptr)(osThreadId_t id))
393-
{
394-
rtos_attach_thread_terminate_hook(fptr);
395-
}
396-
397321
Thread::~Thread()
398322
{
399323
// terminate is thread safe

0 commit comments

Comments
 (0)
Please sign in to comment.