Skip to content

Commit af1832d

Browse files
committed
RTOS: Thread: Update docs; make singal_clr static as it's affects running thread
1 parent a39ac60 commit af1832d

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

rtos/Thread.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,6 @@ int32_t Thread::signal_set(int32_t flags) {
162162
return osThreadFlagsSet(_tid, flags);
163163
}
164164

165-
int32_t Thread::signal_clr(int32_t flags) {
166-
return osThreadFlagsClear(flags);
167-
}
168-
169165
Thread::State Thread::get_state() {
170166
uint8_t state = osThreadTerminated;
171167

@@ -284,6 +280,10 @@ const char *Thread::get_name() {
284280
return _attr.name;
285281
}
286282

283+
int32_t Thread::signal_clr(int32_t flags) {
284+
return osThreadFlagsClear(flags);
285+
}
286+
287287
osEvent Thread::signal_wait(int32_t signals, uint32_t millisec) {
288288
uint32_t res;
289289
osEvent evt;

rtos/Thread.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -245,18 +245,12 @@ class Thread : private mbed::NonCopyable<Thread> {
245245
*/
246246
osPriority get_priority();
247247

248-
/** Set the specified Signal Flags of an active thread.
248+
/** Set the specified Thread Flags for the thread.
249249
@param signals specifies the signal flags of the thread that should be set.
250250
@return previous signal flags of the specified thread or osFlagsError in case of incorrect parameters.
251251
*/
252252
int32_t signal_set(int32_t signals);
253253

254-
/** Clears the specified Signal Flags of an active thread.
255-
@param signals specifies the signal flags of the thread that should be cleared.
256-
@return resultant signal flags of the specified thread or osFlagsError in case of incorrect parameters.
257-
*/
258-
int32_t signal_clr(int32_t signals);
259-
260254
/** State of the Thread */
261255
enum State {
262256
Inactive, /**< Not created */
@@ -310,10 +304,16 @@ class Thread : private mbed::NonCopyable<Thread> {
310304
*/
311305
const char *get_name();
312306

313-
/** Wait for one or more Signal Flags to become signaled for the current RUNNING thread.
307+
/** Clears the specified Thread Flags of the currently running thread.
308+
@param signals specifies the signal flags of the thread that should be cleared.
309+
@return resultant signal flags of the specified thread or osFlagsError in case of incorrect parameters.
310+
*/
311+
static int32_t signal_clr(int32_t signals);
312+
313+
/** Wait for one or more Thread Flags to become signaled for the current RUNNING thread.
314314
@param signals wait until all specified signal flags are set or 0 for any single signal flag.
315315
@param millisec timeout value or 0 in case of no time-out. (default: osWaitForever).
316-
@return event flag information or error code.
316+
@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.
317317
@note not callable from interrupt
318318
*/
319319
static osEvent signal_wait(int32_t signals, uint32_t millisec=osWaitForever);

0 commit comments

Comments
 (0)