MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / put

Method put

components/libc/cplusplus/os/cxx_mail.h:45–55  ·  view source on GitHub ↗

Put a mail in the queue. @param mptr memory block previously allocated with Mail::alloc or Mail::calloc. @return status code that indicates the execution status of the function. */

Source from the content-addressed store, hash-verified

43 @return status code that indicates the execution status of the function.
44 */
45 bool put(T *mptr, int32_t millisec = 0)
46 {
47 rt_int32_t tick;
48
49 if (millisec < 0)
50 tick = -1;
51 else
52 tick = rt_tick_from_millisecond(millisec);
53
54 return rt_mb_send_wait(&mID, (rt_ubase_t)mptr, tick) == RT_EOK;
55 }
56
57 /** Get a mail from a queue.
58 @param millisec timeout value or 0 in case of no time-out. (default: osWaitForever).

Callers

nothing calls this directly

Calls 2

rt_tick_from_millisecondFunction · 0.85
rt_mb_send_waitFunction · 0.85

Tested by

no test coverage detected