RTOS: Thread: Update docs; make singal_clr static as it's affects running thread

pull/4620/head
Bartek Szatkowski 2017-06-21 11:32:02 +01:00
parent a39ac60305
commit af1832d4c7
2 changed files with 13 additions and 13 deletions

View File

@ -162,10 +162,6 @@ int32_t Thread::signal_set(int32_t flags) {
return osThreadFlagsSet(_tid, flags); return osThreadFlagsSet(_tid, flags);
} }
int32_t Thread::signal_clr(int32_t flags) {
return osThreadFlagsClear(flags);
}
Thread::State Thread::get_state() { Thread::State Thread::get_state() {
uint8_t state = osThreadTerminated; uint8_t state = osThreadTerminated;
@ -284,6 +280,10 @@ const char *Thread::get_name() {
return _attr.name; return _attr.name;
} }
int32_t Thread::signal_clr(int32_t flags) {
return osThreadFlagsClear(flags);
}
osEvent Thread::signal_wait(int32_t signals, uint32_t millisec) { osEvent Thread::signal_wait(int32_t signals, uint32_t millisec) {
uint32_t res; uint32_t res;
osEvent evt; osEvent evt;

View File

@ -245,18 +245,12 @@ public:
*/ */
osPriority get_priority(); osPriority get_priority();
/** Set the specified Signal Flags of an active thread. /** Set the specified Thread Flags for the thread.
@param signals specifies the signal flags of the thread that should be set. @param signals specifies the signal flags of the thread that should be set.
@return previous signal flags of the specified thread or osFlagsError in case of incorrect parameters. @return previous signal flags of the specified thread or osFlagsError in case of incorrect parameters.
*/ */
int32_t signal_set(int32_t signals); int32_t signal_set(int32_t signals);
/** Clears the specified Signal Flags of an active thread.
@param signals specifies the signal flags of the thread that should be cleared.
@return resultant signal flags of the specified thread or osFlagsError in case of incorrect parameters.
*/
int32_t signal_clr(int32_t signals);
/** State of the Thread */ /** State of the Thread */
enum State { enum State {
Inactive, /**< Not created */ Inactive, /**< Not created */
@ -310,10 +304,16 @@ public:
*/ */
const char *get_name(); const char *get_name();
/** Wait for one or more Signal Flags to become signaled for the current RUNNING thread. /** Clears the specified Thread Flags of the currently running thread.
@param signals specifies the signal flags of the thread that should be cleared.
@return resultant signal flags of the specified thread or osFlagsError in case of incorrect parameters.
*/
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 signals wait until all specified signal flags are set or 0 for any single signal flag.
@param millisec timeout value or 0 in case of no time-out. (default: osWaitForever). @param millisec timeout value or 0 in case of no time-out. (default: osWaitForever).
@return event flag information or error code. @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 not callable from interrupt @note not callable from interrupt
*/ */
static osEvent signal_wait(int32_t signals, uint32_t millisec=osWaitForever); static osEvent signal_wait(int32_t signals, uint32_t millisec=osWaitForever);