@@ -360,14 +360,33 @@ class Thread : private mbed::NonCopyable<Thread> {
360
360
*/
361
361
static osEvent signal_wait (int32_t signals, uint32_t millisec=osWaitForever);
362
362
363
- /* * Wait for a specified time period in millisec:
363
+ /* * Wait for a specified time period in milliseconds
364
+ Being tick-based, the delay will be up to the specified time - eg for
365
+ a value of 1 the system waits until the next millisecond tick occurs,
366
+ leading to a delay of 0-1 milliseconds.
364
367
@param millisec time delay value
365
368
@return status code that indicates the execution status of the function.
366
369
367
370
@note You cannot call this function from ISR context.
368
371
*/
369
372
static osStatus wait (uint32_t millisec);
370
373
374
+ /* * Wait until a specified time in millisec
375
+ The specified time is according to Kernel::get_ms_count().
376
+ @param millisec absolute time in millisec
377
+ @return status code that indicates the execution status of the function.
378
+ @note not callable from interrupt
379
+ @note if millisec is equal to or lower than the current tick count, this
380
+ returns immediately, either with an error or "osOK".
381
+ @note the underlying RTOS may have a limit to the maximum wait time
382
+ due to internal 32-bit computations, but this is guaranteed to work if the
383
+ delay is <= 0x7fffffff milliseconds (~24 days). If the limit is exceeded,
384
+ it may return with an immediate error, or wait for the maximum delay.
385
+
386
+ @note You cannot call this function from ISR context.
387
+ */
388
+ static osStatus wait_until (uint64_t millisec);
389
+
371
390
/* * Pass control to next thread that is in state READY.
372
391
@return status code that indicates the execution status of the function.
373
392
0 commit comments