MCPcopy Index your code
hub / github.com/RT-Thread/rt-thread / rt_thread_startup

Function rt_thread_startup

src/thread.c:406–423  ·  view source on GitHub ↗

* @brief This function will start a thread and put it to system ready queue. * * @param thread Handle of the thread to be started. * * @return Return the operation status. If the return value is `RT_EOK`, the * function is successfully executed. * If the return value is any other values, it means this operation failed. */

Source from the content-addressed store, hash-verified

404 * If the return value is any other values, it means this operation failed.
405 */
406rt_err_t rt_thread_startup(rt_thread_t thread)
407{
408 /* parameter check */
409 RT_ASSERT(thread != RT_NULL);
410 RT_ASSERT((RT_SCHED_CTX(thread).stat & RT_THREAD_STAT_MASK) == RT_THREAD_INIT);
411 RT_ASSERT(rt_object_get_type((rt_object_t)thread) == RT_Object_Class_Thread);
412
413 LOG_D("startup a thread:%s with priority:%d",
414 thread->parent.name, RT_SCHED_PRIV(thread).current_priority);
415
416 /* calculate priority attribute and reset thread stat to suspend */
417 rt_sched_thread_startup(thread);
418
419 /* resume and do a schedule if scheduler is available */
420 rt_thread_resume(thread);
421
422 return RT_EOK;
423}
424RTM_EXPORT(rt_thread_startup);
425
426/**

Callers 15

finsh_system_initFunction · 0.85
mprotect_example_ro_dataFunction · 0.85
rt_usbd_core_initFunction · 0.85
rt_usb_vcom_initFunction · 0.85
audio_speaker_initFunction · 0.85
rt_usb_hid_initFunction · 0.85
audio_mic_initFunction · 0.85
rt_usbh_hub_initFunction · 0.85
rt_usbh_hid_kbd_initFunction · 0.85
rt_usbh_hid_mouse_initFunction · 0.85
lwp_execveFunction · 0.85

Calls 3

rt_object_get_typeFunction · 0.85
rt_thread_resumeFunction · 0.85
rt_sched_thread_startupFunction · 0.70

Tested by 15

utest_thread_createFunction · 0.68
test_tcpFunction · 0.68
test_udpFunction · 0.68
sys_run_taskFunction · 0.68
gpio_output_taskFunction · 0.68
gpio_input_taskFunction · 0.68
uart_taskFunction · 0.68
adc_taskFunction · 0.68
usbd_taskFunction · 0.68
sys_run_taskFunction · 0.68
gpio_output_taskFunction · 0.68
gpio_input_taskFunction · 0.68