mirror of https://github.com/ARMmbed/mbed-os.git
Thread: remove methods deprecated in 5.10
parent
d23db1a1e4
commit
a0197dba49
|
@ -21,11 +21,6 @@ using namespace rtos;
|
|||
|
||||
osStatus Thread_stub::osStatus_value = osOK;
|
||||
|
||||
osStatus Thread::wait_until(uint64_t millisec)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
osStatus Thread::terminate()
|
||||
{
|
||||
return 0;
|
||||
|
|
119
rtos/Thread.h
119
rtos/Thread.h
|
@ -171,19 +171,6 @@ public:
|
|||
*/
|
||||
uint32_t flags_set(uint32_t flags);
|
||||
|
||||
/** Set the specified Thread Flags for the thread.
|
||||
@param signals specifies the signal flags of the thread that should be set.
|
||||
@return signal flags after setting or osFlagsError in case of incorrect parameters.
|
||||
|
||||
@note You may call this function from ISR context.
|
||||
@deprecated Other signal_xxx methods have been deprecated in favour of ThisThread::flags functions.
|
||||
To match this naming scheme, derived from CMSIS-RTOS2, Thread::flags_set is now provided.
|
||||
*/
|
||||
MBED_DEPRECATED_SINCE("mbed-os-5.10",
|
||||
"Other signal_xxx methods have been deprecated in favour of ThisThread::flags functions. "
|
||||
"To match this naming scheme, derived from CMSIS-RTOS2, Thread::flags_set is now provided.")
|
||||
int32_t signal_set(int32_t signals);
|
||||
|
||||
/** State of the Thread */
|
||||
enum State {
|
||||
Inactive, /**< NOT USED */
|
||||
|
@ -256,112 +243,6 @@ public:
|
|||
*/
|
||||
osThreadId_t get_id() const;
|
||||
|
||||
/** Clears the specified Thread Flags of the currently running thread.
|
||||
@param signals specifies the signal flags of the thread that should be cleared.
|
||||
@return signal flags before clearing or osFlagsError in case of incorrect parameters.
|
||||
|
||||
@note You cannot call this function from ISR context.
|
||||
@deprecated Static methods only affecting current thread cause confusion. Replaced by ThisThread::flags_clear.
|
||||
*/
|
||||
MBED_DEPRECATED_SINCE("mbed-os-5.10",
|
||||
"Static methods only affecting current thread cause confusion. "
|
||||
"Replaced by ThisThread::flags_clear.")
|
||||
static int32_t signal_clr(int32_t signals);
|
||||
|
||||
/** Wait for one or more Thread Flags to become signaled for the current RUNNING thread.
|
||||
@param signals wait until all specified signal flags are set or 0 for any single signal flag.
|
||||
@param millisec timeout value. (default: osWaitForever).
|
||||
@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.
|
||||
|
||||
@note You cannot call this function from ISR context.
|
||||
@deprecated Static methods only affecting current thread cause confusion.
|
||||
Replaced by ThisThread::flags_wait_all, ThisThread::flags_wait_all_for, ThisThread::flags_wait_any and ThisThread:wait_any_for.
|
||||
*/
|
||||
MBED_DEPRECATED_SINCE("mbed-os-5.10",
|
||||
"Static methods only affecting current thread cause confusion. "
|
||||
"Replaced by ThisThread::flags_wait_all, ThisThread::flags_wait_all_for, ThisThread::flags_wait_any and ThisThread:wait_any_for.")
|
||||
static osEvent signal_wait(int32_t signals, uint32_t millisec = osWaitForever);
|
||||
|
||||
/** Wait for a specified time period in milliseconds
|
||||
Being tick-based, the delay will be up to the specified time - eg for
|
||||
a value of 1 the system waits until the next millisecond tick occurs,
|
||||
leading to a delay of 0-1 milliseconds.
|
||||
@param millisec time delay value
|
||||
@return status code that indicates the execution status of the function.
|
||||
|
||||
@note You cannot call this function from ISR context.
|
||||
@deprecated Static methods only affecting current thread cause confusion. Replaced by ThisThread::sleep_for.
|
||||
*/
|
||||
MBED_DEPRECATED_SINCE("mbed-os-5.10",
|
||||
"Static methods only affecting current thread cause confusion. "
|
||||
"Replaced by ThisThread::sleep_for.")
|
||||
static osStatus wait(uint32_t millisec);
|
||||
|
||||
/** Wait until a specified time in millisec
|
||||
The specified time is according to Kernel::get_ms_count().
|
||||
@param millisec absolute time in millisec
|
||||
@return status code that indicates the execution status of the function.
|
||||
@note not callable from interrupt
|
||||
@note if millisec is equal to or lower than the current tick count, this
|
||||
returns immediately, either with an error or "osOK".
|
||||
@note the underlying RTOS may have a limit to the maximum wait time
|
||||
due to internal 32-bit computations, but this is guaranteed to work if the
|
||||
delay is <= 0x7fffffff milliseconds (~24 days). If the limit is exceeded,
|
||||
it may return with an immediate error, or wait for the maximum delay.
|
||||
|
||||
@note You cannot call this function from ISR context.
|
||||
@deprecated Static methods only affecting current thread cause confusion. Replaced by ThisThread::sleep_until.
|
||||
*/
|
||||
MBED_DEPRECATED_SINCE("mbed-os-5.10",
|
||||
"Static methods only affecting current thread cause confusion. "
|
||||
"Replaced by ThisThread::sleep_until.")
|
||||
static osStatus wait_until(uint64_t millisec);
|
||||
|
||||
/** Pass control to next thread that is in state READY.
|
||||
@return status code that indicates the execution status of the function.
|
||||
|
||||
@note You cannot call this function from ISR context.
|
||||
@deprecated Static methods only affecting current thread cause confusion. Replaced by ThisThread::sleep_until.
|
||||
*/
|
||||
MBED_DEPRECATED_SINCE("mbed-os-5.10",
|
||||
"Static methods only affecting current thread cause confusion. "
|
||||
"Replaced by ThisThread::yield.")
|
||||
static osStatus yield();
|
||||
|
||||
/** Get the thread id of the current running thread.
|
||||
@return thread ID for reference by other functions or nullptr in case of error.
|
||||
|
||||
@note You may call this function from ISR context.
|
||||
@deprecated Static methods only affecting current thread cause confusion. Replaced by ThisThread::get_id.
|
||||
Use Thread::get_id for the ID of a specific Thread.
|
||||
*/
|
||||
MBED_DEPRECATED_SINCE("mbed-os-5.10",
|
||||
"Static methods only affecting current thread cause confusion. "
|
||||
"Replaced by ThisThread::get_id. Use Thread::get_id for the ID of a specific Thread.")
|
||||
static osThreadId gettid();
|
||||
|
||||
/** Attach a function to be called by the RTOS idle task
|
||||
@param fptr pointer to the function to be called
|
||||
|
||||
@note You may call this function from ISR context.
|
||||
@deprecated Static methods affecting system cause confusion. Replaced by Kernel::attach_idle_hook.
|
||||
*/
|
||||
MBED_DEPRECATED_SINCE("mbed-os-5.10",
|
||||
"Static methods affecting system cause confusion. "
|
||||
"Replaced by Kernel::attach_idle_hook.")
|
||||
static void attach_idle_hook(void (*fptr)(void));
|
||||
|
||||
/** Attach a function to be called when a task is killed
|
||||
@param fptr pointer to the function to be called
|
||||
|
||||
@note You may call this function from ISR context.
|
||||
@deprecated Static methods affecting system cause confusion. Replaced by Kernel::attach_thread_terminate_hook.
|
||||
*/
|
||||
MBED_DEPRECATED_SINCE("mbed-os-5.10",
|
||||
"Static methods affecting system cause confusion. "
|
||||
"Replaced by Kernel::attach_thread_terminate_hook.")
|
||||
static void attach_terminate_hook(void (*fptr)(osThreadId id));
|
||||
|
||||
/** Thread destructor
|
||||
*
|
||||
* @note You cannot call this function from ISR context.
|
||||
|
|
|
@ -175,11 +175,6 @@ uint32_t Thread::flags_set(uint32_t flags)
|
|||
return flags;
|
||||
}
|
||||
|
||||
int32_t Thread::signal_set(int32_t flags)
|
||||
{
|
||||
return osThreadFlagsSet(_tid, flags);
|
||||
}
|
||||
|
||||
Thread::State Thread::get_state() const
|
||||
{
|
||||
uint8_t state = osThreadTerminated;
|
||||
|
@ -323,77 +318,6 @@ osThreadId_t Thread::get_id() const
|
|||
return _tid;
|
||||
}
|
||||
|
||||
int32_t Thread::signal_clr(int32_t flags)
|
||||
{
|
||||
return osThreadFlagsClear(flags);
|
||||
}
|
||||
|
||||
osEvent Thread::signal_wait(int32_t signals, uint32_t millisec)
|
||||
{
|
||||
uint32_t res;
|
||||
osEvent evt;
|
||||
uint32_t options = osFlagsWaitAll;
|
||||
if (signals == 0) {
|
||||
options = osFlagsWaitAny;
|
||||
signals = 0x7FFFFFFF;
|
||||
}
|
||||
res = osThreadFlagsWait(signals, options, millisec);
|
||||
if (res & osFlagsError) {
|
||||
switch (res) {
|
||||
case osFlagsErrorISR:
|
||||
evt.status = osErrorISR;
|
||||
break;
|
||||
case osFlagsErrorResource:
|
||||
evt.status = osOK;
|
||||
break;
|
||||
case osFlagsErrorTimeout:
|
||||
evt.status = (osStatus)osEventTimeout;
|
||||
break;
|
||||
case osFlagsErrorParameter:
|
||||
default:
|
||||
evt.status = (osStatus)osErrorValue;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
evt.status = (osStatus)osEventSignal;
|
||||
evt.value.signals = res;
|
||||
}
|
||||
|
||||
return evt;
|
||||
}
|
||||
|
||||
osStatus Thread::wait(uint32_t millisec)
|
||||
{
|
||||
ThisThread::sleep_for(millisec);
|
||||
return osOK;
|
||||
}
|
||||
|
||||
osStatus Thread::wait_until(uint64_t millisec)
|
||||
{
|
||||
ThisThread::sleep_until(millisec);
|
||||
return osOK;
|
||||
}
|
||||
|
||||
osStatus Thread::yield()
|
||||
{
|
||||
return osThreadYield();
|
||||
}
|
||||
|
||||
osThreadId Thread::gettid()
|
||||
{
|
||||
return osThreadGetId();
|
||||
}
|
||||
|
||||
void Thread::attach_idle_hook(void (*fptr)(void))
|
||||
{
|
||||
rtos_attach_idle_hook(fptr);
|
||||
}
|
||||
|
||||
void Thread::attach_terminate_hook(void (*fptr)(osThreadId_t id))
|
||||
{
|
||||
rtos_attach_thread_terminate_hook(fptr);
|
||||
}
|
||||
|
||||
Thread::~Thread()
|
||||
{
|
||||
// terminate is thread safe
|
||||
|
|
Loading…
Reference in New Issue