coccinelle: standardize k_thread create/define calls with integer timeouts
Re-run with updated script to convert integer literal delay arguments to k_thread_create and K_THREAD_DEFINE to use the standard timeout macros. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
03c22b8c94
commit
e28f330a8e
86 changed files with 201 additions and 180 deletions
|
@ -130,7 +130,7 @@ int adt7420_init_interrupt(struct device *dev)
|
|||
CONFIG_ADT7420_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)adt7420_thread, dev,
|
||||
0, NULL, K_PRIO_COOP(CONFIG_ADT7420_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_ADT7420_TRIGGER_GLOBAL_THREAD)
|
||||
drv_data->work.handler = adt7420_work_cb;
|
||||
drv_data->dev = dev;
|
||||
|
|
|
@ -160,7 +160,7 @@ int adxl362_init_interrupt(struct device *dev)
|
|||
CONFIG_ADXL362_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)adxl362_thread, dev,
|
||||
0, NULL, K_PRIO_COOP(CONFIG_ADXL362_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_ADXL362_TRIGGER_GLOBAL_THREAD)
|
||||
drv_data->work.handler = adxl362_work_cb;
|
||||
drv_data->dev = dev;
|
||||
|
|
|
@ -165,7 +165,7 @@ int adxl372_init_interrupt(struct device *dev)
|
|||
CONFIG_ADXL372_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)adxl372_thread, dev,
|
||||
0, NULL, K_PRIO_COOP(CONFIG_ADXL372_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_ADXL372_TRIGGER_GLOBAL_THREAD)
|
||||
drv_data->work.handler = adxl372_work_cb;
|
||||
drv_data->dev = dev;
|
||||
|
|
|
@ -183,7 +183,7 @@ int amg88xx_init_interrupt(struct device *dev)
|
|||
CONFIG_AMG88XX_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)amg88xx_thread, dev,
|
||||
0, NULL, K_PRIO_COOP(CONFIG_AMG88XX_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_AMG88XX_TRIGGER_GLOBAL_THREAD)
|
||||
drv_data->work.handler = amg88xx_work_cb;
|
||||
drv_data->dev = dev;
|
||||
|
|
|
@ -270,7 +270,7 @@ int bma280_init_interrupt(struct device *dev)
|
|||
CONFIG_BMA280_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)bma280_thread, dev,
|
||||
0, NULL, K_PRIO_COOP(CONFIG_BMA280_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_BMA280_TRIGGER_GLOBAL_THREAD)
|
||||
drv_data->work.handler = bma280_work_cb;
|
||||
drv_data->dev = dev;
|
||||
|
|
|
@ -126,7 +126,7 @@ int hmc5883l_init_interrupt(struct device *dev)
|
|||
CONFIG_HMC5883L_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)hmc5883l_thread, dev,
|
||||
0, NULL, K_PRIO_COOP(CONFIG_HMC5883L_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_HMC5883L_TRIGGER_GLOBAL_THREAD)
|
||||
drv_data->work.handler = hmc5883l_work_cb;
|
||||
drv_data->dev = dev;
|
||||
|
|
|
@ -136,7 +136,7 @@ int hts221_init_interrupt(struct device *dev)
|
|||
CONFIG_HTS221_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)hts221_thread, dev,
|
||||
0, NULL, K_PRIO_COOP(CONFIG_HTS221_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_HTS221_TRIGGER_GLOBAL_THREAD)
|
||||
drv_data->work.handler = hts221_work_cb;
|
||||
drv_data->dev = dev;
|
||||
|
|
|
@ -180,7 +180,7 @@ int isl29035_init_interrupt(struct device *dev)
|
|||
CONFIG_ISL29035_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)isl29035_thread, dev,
|
||||
0, NULL, K_PRIO_COOP(CONFIG_ISL29035_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_ISL29035_TRIGGER_GLOBAL_THREAD)
|
||||
drv_data->work.handler = isl29035_work_cb;
|
||||
drv_data->dev = dev;
|
||||
|
|
|
@ -147,7 +147,7 @@ int lis2ds12_trigger_init(struct device *dev)
|
|||
CONFIG_LIS2DS12_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)lis2ds12_thread, dev,
|
||||
0, NULL, K_PRIO_COOP(CONFIG_LIS2DS12_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_LIS2DS12_TRIGGER_GLOBAL_THREAD)
|
||||
data->work.handler = lis2ds12_work_cb;
|
||||
data->dev = dev;
|
||||
|
|
|
@ -129,7 +129,7 @@ int lis2mdl_init_interrupt(struct device *dev)
|
|||
CONFIG_LIS2MDL_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)lis2mdl_thread, dev,
|
||||
0, NULL, K_PRIO_COOP(CONFIG_LIS2MDL_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_LIS2MDL_TRIGGER_GLOBAL_THREAD)
|
||||
lis2mdl->work.handler = lis2mdl_work_cb;
|
||||
lis2mdl->dev = dev;
|
||||
|
|
|
@ -139,7 +139,7 @@ int lis3mdl_init_interrupt(struct device *dev)
|
|||
CONFIG_LIS3MDL_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)lis3mdl_thread, POINTER_TO_INT(dev),
|
||||
0, NULL, K_PRIO_COOP(CONFIG_LIS3MDL_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_LIS3MDL_TRIGGER_GLOBAL_THREAD)
|
||||
drv_data->work.handler = lis3mdl_work_cb;
|
||||
drv_data->dev = dev;
|
||||
|
|
|
@ -137,7 +137,7 @@ int lsm6dsl_init_interrupt(struct device *dev)
|
|||
CONFIG_LSM6DSL_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)lsm6dsl_thread, dev,
|
||||
0, NULL, K_PRIO_COOP(CONFIG_LSM6DSL_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_LSM6DSL_TRIGGER_GLOBAL_THREAD)
|
||||
drv_data->work.handler = lsm6dsl_work_cb;
|
||||
drv_data->dev = dev;
|
||||
|
|
|
@ -134,7 +134,7 @@ int mpu6050_init_interrupt(struct device *dev)
|
|||
CONFIG_MPU6050_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)mpu6050_thread, dev,
|
||||
0, NULL, K_PRIO_COOP(CONFIG_MPU6050_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_MPU6050_TRIGGER_GLOBAL_THREAD)
|
||||
drv_data->work.handler = mpu6050_work_cb;
|
||||
drv_data->dev = dev;
|
||||
|
|
|
@ -223,7 +223,7 @@ int sht3xd_init_interrupt(struct device *dev)
|
|||
CONFIG_SHT3XD_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)sht3xd_thread, dev,
|
||||
0, NULL, K_PRIO_COOP(CONFIG_SHT3XD_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_SHT3XD_TRIGGER_GLOBAL_THREAD)
|
||||
data->work.handler = sht3xd_work_cb;
|
||||
#endif
|
||||
|
|
|
@ -172,7 +172,7 @@ int tmp007_init_interrupt(struct device *dev)
|
|||
CONFIG_TMP007_THREAD_STACK_SIZE,
|
||||
(k_thread_entry_t)tmp007_thread, dev,
|
||||
0, NULL, K_PRIO_COOP(CONFIG_TMP007_THREAD_PRIORITY),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
#elif defined(CONFIG_TMP007_TRIGGER_GLOBAL_THREAD)
|
||||
drv_data->work.handler = tmp007_work_cb;
|
||||
drv_data->dev = dev;
|
||||
|
|
|
@ -30,7 +30,7 @@ void k_work_q_start(struct k_work_q *work_q, k_thread_stack_t *stack,
|
|||
{
|
||||
k_queue_init(&work_q->queue);
|
||||
(void)k_thread_create(&work_q->thread, stack, stack_size, z_work_q_main,
|
||||
work_q, NULL, NULL, prio, 0, 0);
|
||||
work_q, NULL, NULL, prio, 0, K_NO_WAIT);
|
||||
|
||||
k_thread_name_set(&work_q->thread, WORKQUEUE_THREAD_NAME);
|
||||
}
|
||||
|
|
|
@ -339,5 +339,5 @@ void main(void)
|
|||
|
||||
k_thread_create(&thread_data, thread_stack, STACKSIZE,
|
||||
(k_thread_entry_t)listen,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(7), 0, 0);
|
||||
NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||
}
|
||||
|
|
|
@ -252,5 +252,5 @@ void main(void)
|
|||
printk("Starting application thread!\n");
|
||||
k_thread_create(&thread_data, thread_stack, APP_TASK_STACK_SIZE,
|
||||
(k_thread_entry_t)app_task,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(7), 0, 0);
|
||||
NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||
}
|
||||
|
|
|
@ -278,7 +278,7 @@ void main(void)
|
|||
printk("Starting application thread!\n");
|
||||
k_thread_create(&thread_data, thread_stack, APP_TASK_STACK_SIZE,
|
||||
(k_thread_entry_t)app_task,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(7), 0, 0);
|
||||
NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||
}
|
||||
|
||||
/* Make sure we clear out the status flag very early (before we bringup the
|
||||
|
|
|
@ -313,4 +313,4 @@ static void log_demo_supervisor(void *p1, void *p2, void *p3)
|
|||
|
||||
K_THREAD_DEFINE(log_demo_thread_id, STACKSIZE, log_demo_supervisor,
|
||||
NULL, NULL, NULL,
|
||||
K_LOWEST_APPLICATION_THREAD_PRIO, 0, 1);
|
||||
K_LOWEST_APPLICATION_THREAD_PRIO, 0, K_MSEC(1));
|
||||
|
|
|
@ -3633,7 +3633,7 @@ void net_if_init(void)
|
|||
k_thread_create(&tx_thread_ts, tx_ts_stack,
|
||||
K_THREAD_STACK_SIZEOF(tx_ts_stack),
|
||||
(k_thread_entry_t)net_tx_ts_thread,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(1), 0, 0);
|
||||
NULL, NULL, NULL, K_PRIO_COOP(1), 0, K_NO_WAIT);
|
||||
k_thread_name_set(&tx_thread_ts, "tx_tstamp");
|
||||
#endif /* CONFIG_NET_PKT_TIMESTAMP_THREAD */
|
||||
|
||||
|
|
|
@ -391,7 +391,8 @@ void net_mgmt_event_init(void)
|
|||
k_thread_create(&mgmt_thread_data, mgmt_stack,
|
||||
K_THREAD_STACK_SIZEOF(mgmt_stack),
|
||||
(k_thread_entry_t)mgmt_thread, NULL, NULL, NULL,
|
||||
K_PRIO_COOP(CONFIG_NET_MGMT_EVENT_THREAD_PRIO), 0, 0);
|
||||
K_PRIO_COOP(CONFIG_NET_MGMT_EVENT_THREAD_PRIO), 0,
|
||||
K_NO_WAIT);
|
||||
k_thread_name_set(&mgmt_thread_data, "net_mgmt");
|
||||
|
||||
NET_DBG("Net MGMT initialized: queue of %u entries, stack size of %u",
|
||||
|
|
|
@ -908,7 +908,7 @@ static void init_ports(void)
|
|||
tid = k_thread_create(&gptp_thread_data, gptp_stack,
|
||||
K_THREAD_STACK_SIZEOF(gptp_stack),
|
||||
(k_thread_entry_t)gptp_thread,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(5), 0, 0);
|
||||
NULL, NULL, NULL, K_PRIO_COOP(5), 0, K_NO_WAIT);
|
||||
k_thread_name_set(&gptp_thread_data, "gptp");
|
||||
}
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ static void conn_mgr(void)
|
|||
|
||||
K_THREAD_DEFINE(conn_mgr_thread, CONFIG_NET_CONNECTION_MANAGER_STACK_SIZE,
|
||||
(k_thread_entry_t)conn_mgr, NULL, NULL, NULL,
|
||||
K_PRIO_COOP(2), 0, 0);
|
||||
K_PRIO_COOP(2), 0, K_NO_WAIT);
|
||||
|
||||
void net_conn_mgr_resend_status(void)
|
||||
{
|
||||
|
|
|
@ -283,7 +283,8 @@ static int run_test(struct unit_test *test)
|
|||
K_THREAD_STACK_SIZEOF(ztest_thread_stack),
|
||||
(k_thread_entry_t) test_cb, (struct unit_test *)test,
|
||||
NULL, NULL, CONFIG_ZTEST_THREAD_PRIORITY,
|
||||
test->thread_options | K_INHERIT_PERMS, 0);
|
||||
test->thread_options | K_INHERIT_PERMS,
|
||||
K_NO_WAIT);
|
||||
/*
|
||||
* There is an implicit expectation here that the thread that was
|
||||
* spawned is still higher priority than the current thread.
|
||||
|
|
|
@ -955,7 +955,7 @@ static int mass_storage_init(struct device *dev)
|
|||
k_thread_create(&mass_thread_data, mass_thread_stack,
|
||||
DISK_THREAD_STACK_SZ,
|
||||
(k_thread_entry_t)mass_thread_main, NULL, NULL, NULL,
|
||||
DISK_THREAD_PRIO, 0, 0);
|
||||
DISK_THREAD_PRIO, 0, K_NO_WAIT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ void main(void)
|
|||
k_tid_t th = k_thread_create(&partner_thread, partner_stack,
|
||||
K_THREAD_STACK_SIZEOF(partner_stack),
|
||||
partner_fn, NULL, NULL, NULL,
|
||||
partner_prio, 0, 0);
|
||||
partner_prio, 0, K_NO_WAIT);
|
||||
|
||||
/* Let it start running and pend */
|
||||
k_sleep(K_MSEC(100));
|
||||
|
|
|
@ -129,7 +129,7 @@ void msg_passing_bench(void)
|
|||
producer_w_cxt_switch_tid =
|
||||
k_thread_create(&my_thread, my_stack_area, STACK_SIZE,
|
||||
thread_producer_msgq_w_cxt_switch, NULL,
|
||||
NULL, NULL, 2 /*priority*/, 0, 50);
|
||||
NULL, NULL, 2 /*priority*/, 0, K_MSEC(50));
|
||||
|
||||
u32_t msg_status = k_msgq_get(&benchmark_q, &received_data,
|
||||
K_MSEC(300));
|
||||
|
@ -137,7 +137,8 @@ void msg_passing_bench(void)
|
|||
producer_wo_cxt_switch_tid =
|
||||
k_thread_create(&my_thread_0, my_stack_area_0, STACK_SIZE,
|
||||
thread_producer_msgq_wo_cxt_switch,
|
||||
NULL, NULL, NULL, -2 /*priority*/, 0, 0);
|
||||
NULL, NULL, NULL, -2 /*priority*/, 0,
|
||||
K_NO_WAIT);
|
||||
|
||||
k_thread_abort(producer_w_cxt_switch_tid);
|
||||
k_thread_abort(producer_wo_cxt_switch_tid);
|
||||
|
@ -152,13 +153,13 @@ void msg_passing_bench(void)
|
|||
k_thread_create(&my_thread, my_stack_area,
|
||||
STACK_SIZE,
|
||||
thread_producer_get_msgq_w_cxt_switch, NULL,
|
||||
NULL, NULL, 1 /*priority*/, 0, 50);
|
||||
NULL, NULL, 1 /*priority*/, 0, K_MSEC(50));
|
||||
consumer_get_w_cxt_switch_tid =
|
||||
k_thread_create(&my_thread_0, my_stack_area_0,
|
||||
STACK_SIZE,
|
||||
thread_consumer_get_msgq_w_cxt_switch,
|
||||
NULL, NULL, NULL,
|
||||
2 /*priority*/, 0, 50);
|
||||
2 /*priority*/, 0, K_MSEC(50));
|
||||
k_sleep(K_MSEC(2000)); /* make the main thread sleep */
|
||||
k_thread_abort(producer_get_w_cxt_switch_tid);
|
||||
__msg_q_get_w_cxt_end_time = (z_arch_timing_value_swap_common);
|
||||
|
@ -187,13 +188,13 @@ void msg_passing_bench(void)
|
|||
STACK_SIZE,
|
||||
thread_mbox_sync_put_send,
|
||||
NULL, NULL, NULL,
|
||||
2 /*priority*/, 0, 0);
|
||||
2 /*priority*/, 0, K_NO_WAIT);
|
||||
thread_mbox_sync_put_receive_tid =
|
||||
k_thread_create(&my_thread_0, my_stack_area_0,
|
||||
STACK_SIZE,
|
||||
thread_mbox_sync_put_receive,
|
||||
NULL, NULL, NULL,
|
||||
1 /*priority*/, 0, 0);
|
||||
1 /*priority*/, 0, K_NO_WAIT);
|
||||
k_sleep(K_MSEC(1000)); /* make the main thread sleep */
|
||||
mbox_sync_put_end_time = (z_arch_timing_value_swap_common);
|
||||
|
||||
|
@ -206,12 +207,12 @@ void msg_passing_bench(void)
|
|||
STACK_SIZE,
|
||||
thread_mbox_sync_get_send,
|
||||
NULL, NULL, NULL,
|
||||
1 /*prio*/, 0, 0);
|
||||
1 /*prio*/, 0, K_NO_WAIT);
|
||||
thread_mbox_sync_get_receive_tid =
|
||||
k_thread_create(&my_thread_0, my_stack_area_0,
|
||||
STACK_SIZE,
|
||||
thread_mbox_sync_get_receive, NULL,
|
||||
NULL, NULL, 2 /*priority*/, 0, 0);
|
||||
NULL, NULL, 2 /*priority*/, 0, K_NO_WAIT);
|
||||
k_sleep(K_MSEC(1000)); /* make the main thread sleep */
|
||||
mbox_sync_get_end_time = (z_arch_timing_value_swap_common);
|
||||
|
||||
|
@ -224,13 +225,13 @@ void msg_passing_bench(void)
|
|||
STACK_SIZE,
|
||||
thread_mbox_async_put_send,
|
||||
NULL, NULL, NULL,
|
||||
2 /*prio*/, 0, 0);
|
||||
2 /*prio*/, 0, K_NO_WAIT);
|
||||
thread_mbox_async_put_receive_tid =
|
||||
k_thread_create(&my_thread_0, my_stack_area_0,
|
||||
STACK_SIZE,
|
||||
thread_mbox_async_put_receive,
|
||||
NULL, NULL, NULL,
|
||||
3 /*priority*/, 0, 0);
|
||||
3 /*priority*/, 0, K_NO_WAIT);
|
||||
k_sleep(K_MSEC(1000)); /* make the main thread sleep */
|
||||
|
||||
/*******************************************************************/
|
||||
|
|
|
@ -54,11 +54,11 @@ void semaphore_bench(void)
|
|||
sem0_tid = k_thread_create(&my_thread, my_stack_area,
|
||||
STACK_SIZE,
|
||||
thread_sem0_test, NULL, NULL, NULL,
|
||||
2 /*priority*/, 0, 0);
|
||||
2 /*priority*/, 0, K_NO_WAIT);
|
||||
sem1_tid = k_thread_create(&my_thread_0, my_stack_area_0,
|
||||
STACK_SIZE, thread_sem1_test,
|
||||
NULL, NULL, NULL,
|
||||
2 /*priority*/, 0, 0);
|
||||
2 /*priority*/, 0, K_NO_WAIT);
|
||||
|
||||
k_sleep(K_MSEC(1000));
|
||||
|
||||
|
@ -70,11 +70,11 @@ void semaphore_bench(void)
|
|||
sem0_tid = k_thread_create(&my_thread, my_stack_area,
|
||||
STACK_SIZE, thread_sem0_give_test,
|
||||
NULL, NULL, NULL,
|
||||
2 /*priority*/, 0, 0);
|
||||
2 /*priority*/, 0, K_NO_WAIT);
|
||||
sem1_tid = k_thread_create(&my_thread_0, my_stack_area_0,
|
||||
STACK_SIZE, thread_sem1_give_test,
|
||||
NULL, NULL, NULL,
|
||||
2 /*priority*/, 0, 0);
|
||||
2 /*priority*/, 0, K_NO_WAIT);
|
||||
|
||||
k_sleep(K_MSEC(1000));
|
||||
sem_give_end_time = (z_arch_timing_value_swap_common);
|
||||
|
|
|
@ -139,7 +139,7 @@ void system_thread_bench(void)
|
|||
k_thread_create(&my_thread_0, my_stack_area_0, STACK_SIZE,
|
||||
thread_swap_test,
|
||||
NULL, NULL, NULL,
|
||||
-1 /*priority*/, 0, 0);
|
||||
-1 /*priority*/, 0, K_NO_WAIT);
|
||||
|
||||
k_sleep(K_MSEC(1));
|
||||
thread_abort_end_time = (z_arch_timing_value_swap_common);
|
||||
|
@ -166,7 +166,7 @@ void system_thread_bench(void)
|
|||
STACK_SIZE,
|
||||
thread_swap_test,
|
||||
NULL, NULL, NULL,
|
||||
5 /*priority*/, 0, 10);
|
||||
5 /*priority*/, 0, K_MSEC(10));
|
||||
TIMING_INFO_PRE_READ();
|
||||
thread_create_end_time = TIMING_INFO_OS_GET_TIME();
|
||||
|
||||
|
@ -183,7 +183,7 @@ void system_thread_bench(void)
|
|||
STACK_SIZE,
|
||||
thread_suspend_test,
|
||||
NULL, NULL, NULL,
|
||||
-1 /*priority*/, 0, 0);
|
||||
-1 /*priority*/, 0, K_NO_WAIT);
|
||||
|
||||
TIMING_INFO_PRE_READ();
|
||||
thread_suspend_end_time = TIMING_INFO_OS_GET_TIME();
|
||||
|
|
|
@ -100,7 +100,7 @@ void drop_to_user_mode(void)
|
|||
k_thread_create(&my_thread_user, my_stack_area_0, STACK_SIZE,
|
||||
drop_to_user_mode_thread,
|
||||
NULL, NULL, NULL,
|
||||
-1 /*priority*/, K_INHERIT_PERMS, 0);
|
||||
-1 /*priority*/, K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
k_yield();
|
||||
|
||||
|
@ -135,7 +135,7 @@ void user_thread_creation(void)
|
|||
k_thread_create(&my_thread_user, my_stack_area, STACK_SIZE,
|
||||
test_drop_to_user_mode_1,
|
||||
NULL, NULL, NULL,
|
||||
0 /*priority*/, K_INHERIT_PERMS | K_USER, 0);
|
||||
0 /*priority*/, K_INHERIT_PERMS | K_USER, K_NO_WAIT);
|
||||
|
||||
TIMING_INFO_PRE_READ();
|
||||
user_thread_creation_end_time = TIMING_INFO_GET_TIMER_VALUE();
|
||||
|
@ -189,7 +189,7 @@ void syscall_overhead(void)
|
|||
k_thread_create(&my_thread_user, my_stack_area_0, STACK_SIZE,
|
||||
syscall_overhead_user_thread,
|
||||
NULL, NULL, NULL,
|
||||
-1 /*priority*/, K_INHERIT_PERMS | K_USER, 0);
|
||||
-1 /*priority*/, K_INHERIT_PERMS | K_USER, K_NO_WAIT);
|
||||
|
||||
|
||||
u32_t total_cycles = (u32_t)
|
||||
|
@ -253,7 +253,7 @@ void validation_overhead(void)
|
|||
k_thread_create(&my_thread_user, my_stack_area, STACK_SIZE,
|
||||
validation_overhead_user_thread,
|
||||
NULL, NULL, NULL,
|
||||
-1 /*priority*/, K_INHERIT_PERMS | K_USER, 0);
|
||||
-1 /*priority*/, K_INHERIT_PERMS | K_USER, K_NO_WAIT);
|
||||
|
||||
|
||||
u32_t total_cycles_obj_init = (u32_t)
|
||||
|
|
|
@ -39,13 +39,13 @@ void yield_bench(void)
|
|||
STACK_SIZE,
|
||||
thread_yield0_test,
|
||||
NULL, NULL, NULL,
|
||||
0 /*priority*/, 0, 0);
|
||||
0 /*priority*/, 0, K_NO_WAIT);
|
||||
|
||||
yield1_tid = k_thread_create(&my_thread_0, my_stack_area_0,
|
||||
STACK_SIZE,
|
||||
thread_yield1_test,
|
||||
NULL, NULL, NULL,
|
||||
0 /*priority*/, 0, 0);
|
||||
0 /*priority*/, 0, K_NO_WAIT);
|
||||
|
||||
/*read the time of start of the sleep till the swap happens */
|
||||
z_arch_timing_value_swap_end = 1U;
|
||||
|
|
|
@ -445,7 +445,7 @@ void testing_spi(void)
|
|||
spi_async_stack, STACK_SIZE,
|
||||
(k_thread_entry_t)spi_async_call_cb,
|
||||
&async_evt, &caller, NULL,
|
||||
K_PRIO_COOP(7), 0, 0);
|
||||
K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||
|
||||
if (spi_complete_loop(spi_slow, &spi_cfg_slow) ||
|
||||
spi_rx_half_start(spi_slow, &spi_cfg_slow) ||
|
||||
|
|
|
@ -56,7 +56,7 @@ void test_timeout_order(void)
|
|||
for (ii = 0; ii < NUM_TIMEOUTS; ii++) {
|
||||
(void)k_thread_create(&threads[ii], stacks[ii], STACKSIZE,
|
||||
thread, INT_TO_POINTER(ii), 0, 0,
|
||||
prio, 0, 0);
|
||||
prio, 0, K_NO_WAIT);
|
||||
k_timer_init(&timer[ii], 0, 0);
|
||||
k_sem_init(&sem[ii], 0, 1);
|
||||
results[ii] = -1;
|
||||
|
|
|
@ -579,7 +579,7 @@ static void k_yield_entry(void *arg0, void *arg1, void *arg2)
|
|||
|
||||
k_thread_create(&thread_data2, thread_stack2, THREAD_STACKSIZE,
|
||||
thread_helper, NULL, NULL, NULL,
|
||||
K_PRIO_COOP(THREAD_PRIORITY - 1), 0, 0);
|
||||
K_PRIO_COOP(THREAD_PRIORITY - 1), 0, K_NO_WAIT);
|
||||
|
||||
zassert_equal(thread_evidence, 0,
|
||||
"Helper created at higher priority ran prematurely.");
|
||||
|
@ -740,7 +740,7 @@ static void test_busy_wait(void)
|
|||
k_thread_create(&timeout_threads[0], timeout_stacks[0],
|
||||
THREAD_STACKSIZE2, busy_wait_thread,
|
||||
INT_TO_POINTER(timeout), NULL,
|
||||
NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, 0);
|
||||
NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, K_NO_WAIT);
|
||||
|
||||
rv = k_sem_take(&reply_timeout, timeout * 2);
|
||||
|
||||
|
@ -767,7 +767,7 @@ static void test_k_sleep(void)
|
|||
k_thread_create(&timeout_threads[0], timeout_stacks[0],
|
||||
THREAD_STACKSIZE2, thread_sleep,
|
||||
INT_TO_POINTER(timeout), NULL,
|
||||
NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, 0);
|
||||
NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, K_NO_WAIT);
|
||||
|
||||
rv = k_sem_take(&reply_timeout, timeout * 2);
|
||||
zassert_equal(rv, 0, " *** thread timed out waiting for thread on "
|
||||
|
@ -888,7 +888,7 @@ void test_k_yield(void)
|
|||
|
||||
k_thread_create(&thread_data1, thread_stack1, THREAD_STACKSIZE,
|
||||
k_yield_entry, NULL, NULL,
|
||||
NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, 0);
|
||||
NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, K_NO_WAIT);
|
||||
|
||||
zassert_equal(thread_evidence, 1,
|
||||
"Thread did not execute as expected!: %d", thread_evidence);
|
||||
|
@ -910,7 +910,7 @@ void test_kernel_thread(void)
|
|||
|
||||
k_thread_create(&thread_data3, thread_stack3, THREAD_STACKSIZE,
|
||||
kernel_thread_entry, NULL, NULL,
|
||||
NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, 0);
|
||||
NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, K_NO_WAIT);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -196,11 +196,11 @@ static void start_threads(void)
|
|||
{
|
||||
k_thread_create(&thread1, stack1, STACK_SIZE,
|
||||
alternate_thread, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(12), 0, 0);
|
||||
K_PRIO_PREEMPT(12), 0, K_NO_WAIT);
|
||||
|
||||
k_thread_create(&thread2, stack2, STACK_SIZE,
|
||||
regression_thread, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(12), 0, 0);
|
||||
K_PRIO_PREEMPT(12), 0, K_NO_WAIT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -112,7 +112,7 @@ static void test_early_sleep(void)
|
|||
helper_tstack, THREAD_STACK,
|
||||
helper_thread, NULL, NULL, NULL,
|
||||
k_thread_priority_get(k_current_get()) + 1,
|
||||
K_INHERIT_PERMS, 0);
|
||||
K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
TC_PRINT("k_sleep() ticks at POST_KERNEL level: %d\n",
|
||||
actual_post_kernel_sleep_ticks);
|
||||
|
|
|
@ -26,7 +26,7 @@ static void tfifo_thread_thread(struct k_fifo *pfifo)
|
|||
{
|
||||
k_tid_t tid = k_thread_create(&thread, tstack, STACK_SIZE,
|
||||
t_cancel_wait_entry, pfifo, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
u32_t start_t = k_uptime_get_32();
|
||||
void *ret = k_fifo_get(pfifo, 500);
|
||||
u32_t dur = k_uptime_get_32() - start_t;
|
||||
|
|
|
@ -90,7 +90,7 @@ static void tfifo_thread_thread(struct k_fifo *pfifo)
|
|||
/**TESTPOINT: thread-thread data passing via fifo*/
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_entry, pfifo, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
tfifo_put(pfifo);
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
k_thread_abort(tid);
|
||||
|
|
|
@ -62,7 +62,7 @@ static void tfifo_read_write(struct k_fifo *pfifo)
|
|||
/**TESTPOINT: thread-isr-thread data passing via fifo*/
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_entry, pfifo, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
|
||||
TC_PRINT("main fifo put ---> ");
|
||||
tfifo_put(pfifo);
|
||||
|
|
|
@ -144,7 +144,7 @@ static int test_multiple_threads_pending(struct timeout_order_data *test_data,
|
|||
tid[ii] = k_thread_create(&ttdata[ii], ttstack[ii], TSTACK_SIZE,
|
||||
test_thread_pend_and_timeout,
|
||||
&test_data[ii], NULL, NULL,
|
||||
FIFO_THREAD_PRIO, K_INHERIT_PERMS, 0);
|
||||
FIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT);
|
||||
}
|
||||
|
||||
/* In general, there is no guarantee of wakeup order when multiple
|
||||
|
@ -218,13 +218,13 @@ static int test_multiple_threads_get_data(struct timeout_order_data *test_data,
|
|||
tid[ii] = k_thread_create(&ttdata[ii], ttstack[ii], TSTACK_SIZE,
|
||||
test_thread_pend_and_get_data,
|
||||
&test_data[ii], NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS, 0);
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS, K_NO_WAIT);
|
||||
}
|
||||
|
||||
tid[ii] = k_thread_create(&ttdata[ii], ttstack[ii], TSTACK_SIZE,
|
||||
test_thread_pend_and_timeout,
|
||||
&test_data[ii], NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS, 0);
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
for (ii = 0; ii < test_data_size-1; ii++) {
|
||||
k_fifo_put(test_data[ii].fifo, get_scratch_packet());
|
||||
|
@ -365,7 +365,7 @@ static void test_timeout_fifo_thread(void)
|
|||
tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
|
||||
test_thread_put_timeout, &fifo_timeout[0],
|
||||
&timeout, NULL,
|
||||
FIFO_THREAD_PRIO, K_INHERIT_PERMS, 0);
|
||||
FIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
packet = k_fifo_get(&fifo_timeout[0], timeout + 10);
|
||||
zassert_true(packet != NULL, NULL);
|
||||
|
@ -381,7 +381,7 @@ static void test_timeout_fifo_thread(void)
|
|||
tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
|
||||
test_thread_timeout_reply_values,
|
||||
&reply_packet, NULL, NULL,
|
||||
FIFO_THREAD_PRIO, K_INHERIT_PERMS, 0);
|
||||
FIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
k_yield();
|
||||
packet = k_fifo_get(&timeout_order_fifo, K_NO_WAIT);
|
||||
|
@ -400,7 +400,7 @@ static void test_timeout_fifo_thread(void)
|
|||
tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
|
||||
test_thread_timeout_reply_values,
|
||||
&reply_packet, NULL, NULL,
|
||||
FIFO_THREAD_PRIO, K_INHERIT_PERMS, 0);
|
||||
FIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
k_yield();
|
||||
packet = k_fifo_get(&timeout_order_fifo, K_NO_WAIT);
|
||||
|
@ -420,7 +420,7 @@ static void test_timeout_fifo_thread(void)
|
|||
tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
|
||||
test_thread_timeout_reply_values_wfe,
|
||||
&reply_packet, NULL, NULL,
|
||||
FIFO_THREAD_PRIO, K_INHERIT_PERMS, 0);
|
||||
FIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
packet = k_fifo_get(&timeout_order_fifo, K_FOREVER);
|
||||
zassert_true(packet != NULL, NULL);
|
||||
|
|
|
@ -156,7 +156,7 @@ static void test_single_fifo_play(void)
|
|||
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_entry_fn_single, &fifo1, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS, 0);
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
/* Let the child thread run */
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
|
@ -187,7 +187,7 @@ static void test_dual_fifo_play(void)
|
|||
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_entry_fn_dual, &fifo1, &fifo2, NULL,
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS, 0);
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
for (i = 0U; i < LIST_LEN; i++) {
|
||||
/* Put item into fifo */
|
||||
|
@ -219,7 +219,7 @@ static void test_isr_fifo_play(void)
|
|||
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_entry_fn_isr, &fifo1, &fifo2, NULL,
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS, 0);
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
|
||||
/* Put item into fifo */
|
||||
|
|
|
@ -61,7 +61,7 @@ static void tlifo_thread_thread(struct k_lifo *plifo)
|
|||
/**TESTPOINT: thread-thread data passing via lifo*/
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_entry, plifo, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
tlifo_put(plifo);
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
k_thread_abort(tid);
|
||||
|
|
|
@ -62,7 +62,7 @@ static void tlifo_read_write(struct k_lifo *plifo)
|
|||
/**TESTPOINT: thread-isr-thread data passing via lifo*/
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_entry, plifo, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
|
||||
TC_PRINT("main lifo put ---> ");
|
||||
tlifo_put(plifo);
|
||||
|
|
|
@ -125,7 +125,7 @@ static int test_multiple_threads_pending(struct timeout_order_data *test_data,
|
|||
tid[ii] = k_thread_create(&ttdata[ii], ttstack[ii], TSTACK_SIZE,
|
||||
test_thread_pend_and_timeout,
|
||||
&test_data[ii], NULL, NULL,
|
||||
LIFO_THREAD_PRIO, K_INHERIT_PERMS, 0);
|
||||
LIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT);
|
||||
}
|
||||
|
||||
for (ii = 0; ii < test_data_size; ii++) {
|
||||
|
@ -218,7 +218,7 @@ static void test_lifo_nowait(void)
|
|||
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_entry_nowait, &lifo, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
|
||||
k_lifo_put(&lifo, (void *)&data[1]);
|
||||
|
||||
|
@ -240,7 +240,7 @@ static void test_lifo_wait(void)
|
|||
|
||||
k_tid_t tid = k_thread_create(&tdata1, tstack1, STACK_SIZE,
|
||||
thread_entry_wait, &plifo, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
|
||||
ret = k_lifo_get(&plifo, K_FOREVER);
|
||||
|
||||
|
@ -322,7 +322,7 @@ static void test_timeout_lifo_thread(void)
|
|||
tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
|
||||
test_thread_put_timeout, &lifo_timeout[0],
|
||||
&timeout, NULL,
|
||||
LIFO_THREAD_PRIO, K_INHERIT_PERMS, 0);
|
||||
LIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
packet = k_lifo_get(&lifo_timeout[0], timeout + 10);
|
||||
zassert_true(packet != NULL, NULL);
|
||||
|
@ -338,7 +338,7 @@ static void test_timeout_lifo_thread(void)
|
|||
tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
|
||||
test_thread_timeout_reply_values,
|
||||
&reply_packet, NULL, NULL,
|
||||
LIFO_THREAD_PRIO, K_INHERIT_PERMS, 0);
|
||||
LIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
k_yield();
|
||||
packet = k_lifo_get(&timeout_order_lifo, K_NO_WAIT);
|
||||
|
@ -357,7 +357,7 @@ static void test_timeout_lifo_thread(void)
|
|||
tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
|
||||
test_thread_timeout_reply_values,
|
||||
&reply_packet, NULL, NULL,
|
||||
LIFO_THREAD_PRIO, K_INHERIT_PERMS, 0);
|
||||
LIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
k_yield();
|
||||
packet = k_lifo_get(&timeout_order_lifo, K_NO_WAIT);
|
||||
|
@ -377,7 +377,7 @@ static void test_timeout_lifo_thread(void)
|
|||
tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
|
||||
test_thread_timeout_reply_values_wfe,
|
||||
&reply_packet, NULL, NULL,
|
||||
LIFO_THREAD_PRIO, K_INHERIT_PERMS, 0);
|
||||
LIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
packet = k_lifo_get(&timeout_order_lifo, K_FOREVER);
|
||||
zassert_true(packet != NULL, NULL);
|
||||
|
|
|
@ -538,7 +538,7 @@ static void tmbox(struct k_mbox *pmbox)
|
|||
sender_tid = k_current_get();
|
||||
receiver_tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tmbox_entry, pmbox, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
tmbox_put(pmbox);
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
|
||||
|
|
|
@ -70,15 +70,15 @@ void test_mpool_alloc_wait_prio(void)
|
|||
/*the low-priority thread*/
|
||||
tid[0] = k_thread_create(&tdata[0], tstack[0], STACK_SIZE,
|
||||
tmpool_alloc_wait_timeout, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(1), 0, 0);
|
||||
K_PRIO_PREEMPT(1), 0, K_NO_WAIT);
|
||||
/*the highest-priority thread that has waited the longest*/
|
||||
tid[1] = k_thread_create(&tdata[1], tstack[1], STACK_SIZE,
|
||||
tmpool_alloc_wait_ok, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 10);
|
||||
K_PRIO_PREEMPT(0), 0, K_MSEC(10));
|
||||
/*the highest-priority thread that has waited shorter*/
|
||||
tid[2] = k_thread_create(&tdata[2], tstack[2], STACK_SIZE,
|
||||
tmpool_alloc_wait_timeout, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 20);
|
||||
K_PRIO_PREEMPT(0), 0, K_MSEC(20));
|
||||
/*relinquish CPU for above threads to start */
|
||||
k_sleep(K_MSEC(30));
|
||||
/*free one block, expected to unblock thread "tid[1]"*/
|
||||
|
|
|
@ -74,7 +74,7 @@ void test_mpool_threadsafe(void)
|
|||
for (int i = 0; i < THREAD_NUM; i++) {
|
||||
tid[i] = k_thread_create(&tdata[i], tstack[i], STACK_SIZE,
|
||||
tmpool_api, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(1), 0, 0);
|
||||
K_PRIO_PREEMPT(1), 0, K_NO_WAIT);
|
||||
}
|
||||
/* TESTPOINT: all threads complete and exit the entry function*/
|
||||
for (int i = 0; i < THREAD_NUM; i++) {
|
||||
|
|
|
@ -72,15 +72,15 @@ void test_mslab_alloc_wait_prio(void)
|
|||
/*the low-priority thread*/
|
||||
tid[0] = k_thread_create(&tdata[0], tstack[0], STACK_SIZE,
|
||||
tmslab_alloc_wait_timeout, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(1), 0, 0);
|
||||
K_PRIO_PREEMPT(1), 0, K_NO_WAIT);
|
||||
/*the highest-priority thread that has waited the longest*/
|
||||
tid[1] = k_thread_create(&tdata[1], tstack[1], STACK_SIZE,
|
||||
tmslab_alloc_wait_ok, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 10);
|
||||
K_PRIO_PREEMPT(0), 0, K_MSEC(10));
|
||||
/*the highest-priority thread that has waited shorter*/
|
||||
tid[2] = k_thread_create(&tdata[2], tstack[2], STACK_SIZE,
|
||||
tmslab_alloc_wait_timeout, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 20);
|
||||
K_PRIO_PREEMPT(0), 0, K_MSEC(20));
|
||||
/*relinquish CPU for above threads to start */
|
||||
k_sleep(K_MSEC(30));
|
||||
/*free one block, expected to unblock thread "tid[1]"*/
|
||||
|
|
|
@ -81,7 +81,7 @@ void test_mslab_threadsafe(void)
|
|||
for (int i = 0; i < THREAD_NUM; i++) {
|
||||
tid[i] = k_thread_create(&tdata[i], tstack[i], STACK_SIZE,
|
||||
tmslab_api, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(1), 0, 0);
|
||||
K_PRIO_PREEMPT(1), 0, K_NO_WAIT);
|
||||
}
|
||||
/* TESTPOINT: all threads complete and exit the entry function*/
|
||||
for (int i = 0; i < THREAD_NUM; i++) {
|
||||
|
|
|
@ -96,7 +96,7 @@ static void msgq_thread(struct k_msgq *pmsgq)
|
|||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_entry, pmsgq, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0),
|
||||
K_USER | K_INHERIT_PERMS, 0);
|
||||
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
|
||||
put_msgq(pmsgq);
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
k_thread_abort(tid);
|
||||
|
@ -134,7 +134,7 @@ static void msgq_thread_overflow(struct k_msgq *pmsgq)
|
|||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_entry_overflow, pmsgq, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0),
|
||||
K_USER | K_INHERIT_PERMS, 0);
|
||||
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
ret = k_msgq_put(pmsgq, (void *)&data[1], K_FOREVER);
|
||||
|
||||
|
@ -184,11 +184,11 @@ static void msgq_thread_data_passing(struct k_msgq *pmsgq)
|
|||
|
||||
k_tid_t tid = k_thread_create(&tdata2, tstack2, STACK_SIZE,
|
||||
pend_thread_entry, pmsgq, NULL,
|
||||
NULL, K_PRIO_PREEMPT(0), 0, 0);
|
||||
NULL, K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
|
||||
k_tid_t tid1 = k_thread_create(&tdata1, tstack1, STACK_SIZE,
|
||||
thread_entry_get_data, pmsgq, NULL,
|
||||
NULL, K_PRIO_PREEMPT(1), 0, 0);
|
||||
NULL, K_PRIO_PREEMPT(1), 0, K_NO_WAIT);
|
||||
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
k_thread_abort(tid);
|
||||
|
|
|
@ -31,7 +31,8 @@ static void purge_when_put(struct k_msgq *q)
|
|||
/*create another thread waiting to put msg*/
|
||||
k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_entry, q, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), K_USER | K_INHERIT_PERMS, 0);
|
||||
K_PRIO_PREEMPT(0), K_USER | K_INHERIT_PERMS,
|
||||
K_NO_WAIT);
|
||||
k_sleep(TIMEOUT >> 1);
|
||||
/**TESTPOINT: msgq purge while another thread waiting to put msg*/
|
||||
k_msgq_purge(q);
|
||||
|
|
|
@ -48,7 +48,7 @@ static void tmutex_test_lock(struct k_mutex *pmutex,
|
|||
k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
entry_fn, pmutex, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0),
|
||||
K_USER | K_INHERIT_PERMS, 0);
|
||||
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
|
||||
k_mutex_lock(pmutex, K_FOREVER);
|
||||
TC_PRINT("access resource from main thread\n");
|
||||
|
||||
|
@ -64,7 +64,7 @@ static void tmutex_test_lock_timeout(struct k_mutex *pmutex,
|
|||
k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
entry_fn, pmutex, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0),
|
||||
K_USER | K_INHERIT_PERMS, 0);
|
||||
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
|
||||
k_mutex_lock(pmutex, K_FOREVER);
|
||||
TC_PRINT("access resource from main thread\n");
|
||||
|
||||
|
|
|
@ -249,10 +249,12 @@ void task_high(void)
|
|||
counter = SEM_TEST_START;
|
||||
|
||||
k_thread_create(&coop_thread[0], coop_stack[0], COOP_STACKSIZE,
|
||||
coop_high, NULL, NULL, NULL, K_PRIO_COOP(3), 0, 0);
|
||||
coop_high, NULL, NULL, NULL, K_PRIO_COOP(3), 0,
|
||||
K_NO_WAIT);
|
||||
|
||||
k_thread_create(&coop_thread[1], coop_stack[1], COOP_STACKSIZE,
|
||||
coop_low, NULL, NULL, NULL, K_PRIO_COOP(7), 0, 0);
|
||||
coop_low, NULL, NULL, NULL, K_PRIO_COOP(7), 0,
|
||||
K_NO_WAIT);
|
||||
|
||||
counter = FIFO_TEST_START;
|
||||
fifo_tests(THIRD_SECOND, &task_high_state, my_fifo_get, k_sem_take);
|
||||
|
|
|
@ -701,7 +701,8 @@ void test_pipe_on_single_elements(void)
|
|||
|
||||
k_thread_create(&get_single_tid, stack_1, STACK_SIZE,
|
||||
pipe_get_single, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, 0);
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER,
|
||||
K_NO_WAIT);
|
||||
|
||||
pipe_put_single();
|
||||
k_sem_take(&sync_sem, K_FOREVER);
|
||||
|
@ -718,7 +719,8 @@ void test_pipe_on_multiple_elements(void)
|
|||
{
|
||||
k_thread_create(&get_single_tid, stack_1, STACK_SIZE,
|
||||
pipe_get_multiple, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, 0);
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER,
|
||||
K_NO_WAIT);
|
||||
|
||||
pipe_put_multiple();
|
||||
k_sem_take(&sync_sem, K_FOREVER);
|
||||
|
@ -735,7 +737,8 @@ void test_pipe_forever_wait(void)
|
|||
{
|
||||
k_thread_create(&get_single_tid, stack_1, STACK_SIZE,
|
||||
pipe_get_forever_wait, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, 0);
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER,
|
||||
K_NO_WAIT);
|
||||
|
||||
pipe_put_forever_wait();
|
||||
k_sem_take(&sync_sem, K_FOREVER);
|
||||
|
@ -752,7 +755,8 @@ void test_pipe_timeout(void)
|
|||
{
|
||||
k_thread_create(&get_single_tid, stack_1, STACK_SIZE,
|
||||
pipe_get_timeout, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, 0);
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER,
|
||||
K_NO_WAIT);
|
||||
|
||||
pipe_put_timeout();
|
||||
k_sem_take(&sync_sem, K_FOREVER);
|
||||
|
@ -784,7 +788,8 @@ void test_pipe_forever_timeout(void)
|
|||
|
||||
k_thread_create(&get_single_tid, stack_1, STACK_SIZE,
|
||||
pipe_get_forever_timeout, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER, 0);
|
||||
K_PRIO_PREEMPT(0), K_INHERIT_PERMS | K_USER,
|
||||
K_NO_WAIT);
|
||||
|
||||
pipe_put_forever_timeout();
|
||||
k_sem_take(&sync_sem, K_FOREVER);
|
||||
|
|
|
@ -106,7 +106,7 @@ static void tpipe_thread_thread(struct k_pipe *ppipe)
|
|||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_entry, ppipe, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0),
|
||||
K_INHERIT_PERMS | K_USER, 0);
|
||||
K_INHERIT_PERMS | K_USER, K_NO_WAIT);
|
||||
|
||||
tpipe_put(ppipe, K_NO_WAIT);
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
|
@ -123,7 +123,7 @@ static void tpipe_kthread_to_kthread(struct k_pipe *ppipe)
|
|||
/**TESTPOINT: thread-thread data passing via pipe*/
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_entry, ppipe, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
|
||||
tpipe_put(ppipe, K_NO_WAIT);
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
|
@ -210,7 +210,7 @@ void test_pipe_block_put(void)
|
|||
/**TESTPOINT: test k_pipe_block_put without semaphore*/
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_block_put, &kpipe, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
|
||||
k_sleep(K_MSEC(10));
|
||||
tpipe_get(&kpipe, K_FOREVER);
|
||||
|
@ -231,7 +231,7 @@ void test_pipe_block_put_sema(void)
|
|||
/**TESTPOINT: test k_pipe_block_put with semaphore*/
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_block_put, &pipe, &sync_sema,
|
||||
NULL, K_PRIO_PREEMPT(0), 0, 0);
|
||||
NULL, K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
k_sleep(K_MSEC(10));
|
||||
tpipe_get(&pipe, K_FOREVER);
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
|
@ -248,7 +248,7 @@ void test_pipe_get_put(void)
|
|||
/**TESTPOINT: test API sequence: [get, put]*/
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_block_put, &kpipe, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
|
||||
/*get will be executed previous to put*/
|
||||
tpipe_get(&kpipe, K_FOREVER);
|
||||
|
@ -291,7 +291,7 @@ void test_half_pipe_get_put(void)
|
|||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_half_pipe_put, &khalfpipe,
|
||||
NULL, NULL, K_PRIO_PREEMPT(0),
|
||||
K_INHERIT_PERMS | K_USER, 0);
|
||||
K_INHERIT_PERMS | K_USER, K_NO_WAIT);
|
||||
|
||||
tpipe_get(&khalfpipe, K_FOREVER);
|
||||
|
||||
|
@ -313,7 +313,7 @@ void test_half_pipe_block_put_sema(void)
|
|||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_half_pipe_block_put,
|
||||
&khalfpipe, &sync_sema, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
|
||||
k_sleep(K_MSEC(10));
|
||||
tpipe_get(&khalfpipe, K_FOREVER);
|
||||
|
@ -352,7 +352,7 @@ void test_pipe_reader_wait(void)
|
|||
/**TESTPOINT: test k_pipe_block_put with semaphore*/
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_handler, &kpipe1, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
|
||||
tpipe_get(&kpipe1, K_FOREVER);
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
|
@ -381,12 +381,12 @@ void test_pipe_block_writer_wait(void)
|
|||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_for_block_put, &kpipe1, &s_sema,
|
||||
NULL, K_PRIO_PREEMPT(main_low_prio - 1),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
|
||||
k_tid_t tid1 = k_thread_create(&tdata1, tstack1, STACK_SIZE,
|
||||
thread_for_block_put, &kpipe1, &s_sema1,
|
||||
NULL, K_PRIO_PREEMPT(main_low_prio - 1),
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
|
||||
tpipe_get(&kpipe1, K_FOREVER);
|
||||
k_thread_priority_set(k_current_get(), old_prio);
|
||||
|
|
|
@ -210,7 +210,8 @@ void test_poll_wait(void)
|
|||
k_thread_create(&test_thread, test_stack,
|
||||
K_THREAD_STACK_SIZEOF(test_stack),
|
||||
poll_wait_helper, (void *)1, 0, 0,
|
||||
main_low_prio - 1, K_USER | K_INHERIT_PERMS, 0);
|
||||
main_low_prio - 1, K_USER | K_INHERIT_PERMS,
|
||||
K_NO_WAIT);
|
||||
|
||||
rc = k_poll(wait_events, ARRAY_SIZE(wait_events), K_SECONDS(1));
|
||||
|
||||
|
@ -266,7 +267,7 @@ void test_poll_wait(void)
|
|||
k_thread_create(&test_thread, test_stack,
|
||||
K_THREAD_STACK_SIZEOF(test_stack),
|
||||
poll_wait_helper,
|
||||
0, 0, 0, main_low_prio - 1, 0, 0);
|
||||
0, 0, 0, main_low_prio - 1, 0, K_NO_WAIT);
|
||||
|
||||
rc = k_poll(wait_events, ARRAY_SIZE(wait_events), K_SECONDS(1));
|
||||
|
||||
|
@ -302,7 +303,7 @@ void test_poll_wait(void)
|
|||
K_THREAD_STACK_SIZEOF(test_stack),
|
||||
poll_wait_helper,
|
||||
(void *)1, 0, 0, old_prio + 1,
|
||||
K_USER | K_INHERIT_PERMS, 0);
|
||||
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
/* semaphore */
|
||||
rc = k_poll(wait_events, ARRAY_SIZE(wait_events), K_SECONDS(1));
|
||||
|
@ -419,7 +420,8 @@ void test_poll_cancel(bool is_main_low_prio)
|
|||
k_thread_create(&test_thread, test_stack,
|
||||
K_THREAD_STACK_SIZEOF(test_stack),
|
||||
poll_cancel_helper, (void *)1, 0, 0,
|
||||
main_low_prio - 1, K_USER | K_INHERIT_PERMS, 0);
|
||||
main_low_prio - 1, K_USER | K_INHERIT_PERMS,
|
||||
K_NO_WAIT);
|
||||
|
||||
rc = k_poll(cancel_events, ARRAY_SIZE(cancel_events), K_SECONDS(1));
|
||||
|
||||
|
@ -519,7 +521,7 @@ void test_poll_multi(void)
|
|||
k_thread_create(&test_thread, test_stack,
|
||||
K_THREAD_STACK_SIZEOF(test_stack),
|
||||
multi, 0, 0, 0, main_low_prio - 1,
|
||||
K_USER | K_INHERIT_PERMS, 0);
|
||||
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
/*
|
||||
* create additional thread to add multiple(more than one) pending threads
|
||||
|
@ -528,7 +530,7 @@ void test_poll_multi(void)
|
|||
k_thread_create(&test_loprio_thread, test_loprio_stack,
|
||||
K_THREAD_STACK_SIZEOF(test_loprio_stack),
|
||||
multi_lowprio, 0, 0, 0, main_low_prio + 1,
|
||||
K_USER | K_INHERIT_PERMS, 0);
|
||||
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
/* Allow lower priority thread to add poll event in the list */
|
||||
k_sleep(K_MSEC(250));
|
||||
|
@ -596,7 +598,8 @@ void test_poll_threadstate(void)
|
|||
|
||||
k_thread_create(&test_thread, test_stack,
|
||||
K_THREAD_STACK_SIZEOF(test_stack), threadstate,
|
||||
ztest_tid, 0, 0, main_low_prio - 1, K_INHERIT_PERMS, 0);
|
||||
ztest_tid, 0, 0, main_low_prio - 1, K_INHERIT_PERMS,
|
||||
K_NO_WAIT);
|
||||
|
||||
/* wait for spawn thread to take action */
|
||||
zassert_equal(k_poll(&event, 1, K_SECONDS(1)), 0, "");
|
||||
|
|
|
@ -111,7 +111,7 @@ static void tqueue_thread_thread(struct k_queue *pqueue)
|
|||
/**TESTPOINT: thread-thread data passing via queue*/
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_entry, pqueue, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
tqueue_append(pqueue);
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
k_thread_abort(tid);
|
||||
|
@ -192,11 +192,11 @@ static void tqueue_get_2threads(struct k_queue *pqueue)
|
|||
k_sem_init(&end_sema, 0, 1);
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_get, pqueue, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
|
||||
k_tid_t tid1 = k_thread_create(&tdata1, tstack1, STACK_SIZE,
|
||||
tThread_get, pqueue, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
|
||||
/* Wait threads to initialize */
|
||||
k_sleep(K_MSEC(10));
|
||||
|
|
|
@ -94,7 +94,7 @@ static void tqueue_read_write(struct k_queue *pqueue)
|
|||
/**TESTPOINT: thread-isr-thread data passing via queue*/
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tThread_entry, pqueue, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
|
||||
TC_PRINT("main queue append ---> ");
|
||||
tqueue_append(pqueue);
|
||||
|
|
|
@ -100,7 +100,7 @@ void test_queue_supv_to_user(void)
|
|||
|
||||
k_thread_create(&child_thread, child_stack, STACK_SIZE,
|
||||
child_thread_get, q, sem, NULL, K_HIGHEST_THREAD_PRIO,
|
||||
K_USER | K_INHERIT_PERMS, 0);
|
||||
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
k_yield();
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ void test_deadline(void)
|
|||
worker_stacks[i], STACK_SIZE,
|
||||
worker, INT_TO_POINTER(i), NULL, NULL,
|
||||
K_LOWEST_APPLICATION_THREAD_PRIO,
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
|
||||
/* Positive-definite number with the bottom 8 bits
|
||||
* masked off to prevent aliasing where "very close"
|
||||
|
|
|
@ -330,12 +330,12 @@ void test_preempt(void)
|
|||
k_thread_create(&worker_threads[i],
|
||||
worker_stacks[i], STACK_SIZE,
|
||||
worker, INT_TO_POINTER(i), NULL, NULL,
|
||||
priority, 0, 0);
|
||||
priority, 0, K_NO_WAIT);
|
||||
}
|
||||
|
||||
k_thread_create(&manager_thread, manager_stack, STACK_SIZE,
|
||||
manager, NULL, NULL, NULL,
|
||||
K_LOWEST_APPLICATION_THREAD_PRIO, 0, 0);
|
||||
K_LOWEST_APPLICATION_THREAD_PRIO, 0, K_NO_WAIT);
|
||||
|
||||
/* We don't control the priority of this thread so can't make
|
||||
* it part of the test. Just get out of the way until the
|
||||
|
|
|
@ -80,7 +80,8 @@ void test_priority_scheduling(void)
|
|||
for (int i = 0; i < NUM_THREAD; i++) {
|
||||
tid[i] = k_thread_create(&t[i], tstacks[i], STACK_SIZE,
|
||||
thread_tslice, INT_TO_POINTER(i), NULL, NULL,
|
||||
K_PRIO_PREEMPT(BASE_PRIORITY + i), 0, 0);
|
||||
K_PRIO_PREEMPT(BASE_PRIORITY + i), 0,
|
||||
K_NO_WAIT);
|
||||
}
|
||||
|
||||
while (count < ITRERATION_COUNT) {
|
||||
|
|
|
@ -72,14 +72,14 @@ void test_sched_is_preempt_thread(void)
|
|||
/*create preempt thread*/
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tpreempt_ctx, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(1), 0, 0);
|
||||
K_PRIO_PREEMPT(1), 0, K_NO_WAIT);
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
k_thread_abort(tid);
|
||||
|
||||
/*create coop thread*/
|
||||
tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
tcoop_ctx, NULL, NULL, NULL,
|
||||
K_PRIO_COOP(1), 0, 0);
|
||||
K_PRIO_COOP(1), 0, K_NO_WAIT);
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
k_thread_abort(tid);
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ void test_priority_cooperative(void)
|
|||
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_entry, NULL, NULL, NULL,
|
||||
spawn_prio, 0, 0);
|
||||
spawn_prio, 0, K_NO_WAIT);
|
||||
/* checkpoint: current thread shouldn't preempted by higher thread */
|
||||
zassert_true(last_prio == k_thread_priority_get(k_current_get()), NULL);
|
||||
k_sleep(K_MSEC(100));
|
||||
|
@ -76,7 +76,7 @@ void test_priority_preemptible(void)
|
|||
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_entry, NULL, NULL, NULL,
|
||||
spawn_prio, 0, 0);
|
||||
spawn_prio, 0, K_NO_WAIT);
|
||||
/* checkpoint: thread is preempted by higher thread */
|
||||
zassert_true(last_prio == spawn_prio, NULL);
|
||||
|
||||
|
@ -86,7 +86,7 @@ void test_priority_preemptible(void)
|
|||
spawn_prio = last_prio + 1;
|
||||
tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_entry, NULL, NULL, NULL,
|
||||
spawn_prio, 0, 0);
|
||||
spawn_prio, 0, K_NO_WAIT);
|
||||
/* checkpoint: thread is not preempted by lower thread */
|
||||
zassert_false(last_prio == spawn_prio, NULL);
|
||||
k_thread_abort(tid);
|
||||
|
|
|
@ -59,7 +59,8 @@ static void spawn_threads(int sleep_sec)
|
|||
STACK_SIZE, thread_entry,
|
||||
INT_TO_POINTER(i),
|
||||
INT_TO_POINTER(sleep_sec),
|
||||
NULL, tdata[i].priority, 0, 0);
|
||||
NULL, tdata[i].priority, 0,
|
||||
K_NO_WAIT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -212,7 +213,7 @@ void test_pending_thread_wakeup(void)
|
|||
k_tid_t tid = k_thread_create(&t, tstack, STACK_SIZE,
|
||||
(k_thread_entry_t)coop_thread,
|
||||
NULL, NULL, NULL,
|
||||
K_PRIO_COOP(1), 0, 0);
|
||||
K_PRIO_COOP(1), 0, K_NO_WAIT);
|
||||
|
||||
zassert_false(executed == 1, "The thread didn't wait"
|
||||
" for semaphore acquisition");
|
||||
|
@ -434,7 +435,7 @@ void test_wakeup_expired_timer_thread(void)
|
|||
{
|
||||
k_tid_t tid = k_thread_create(&tthread[0], tstack, STACK_SIZE,
|
||||
thread_handler, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), 0, 0);
|
||||
K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
k_sem_take(&timer_sema, K_FOREVER);
|
||||
/* wakeup a thread if the timer is expired */
|
||||
k_wakeup(tid);
|
||||
|
|
|
@ -124,7 +124,8 @@ void test_slice_reset(void)
|
|||
for (int i = 0; i < NUM_THREAD; i++) {
|
||||
tid[i] = k_thread_create(&t[i], tstacks[i], STACK_SIZE,
|
||||
thread_time_slice, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(j), 0, 0);
|
||||
K_PRIO_PREEMPT(j), 0,
|
||||
K_NO_WAIT);
|
||||
}
|
||||
/* enable time slice*/
|
||||
k_sched_time_slice_set(SLICE_SIZE, K_PRIO_PREEMPT(0));
|
||||
|
|
|
@ -101,7 +101,8 @@ void test_slice_scheduling(void)
|
|||
tid[i] = k_thread_create(&t[i], tstacks[i], STACK_SIZE,
|
||||
thread_tslice,
|
||||
INT_TO_POINTER(i), NULL, NULL,
|
||||
K_PRIO_PREEMPT(BASE_PRIORITY), 0, 0);
|
||||
K_PRIO_PREEMPT(BASE_PRIORITY), 0,
|
||||
K_NO_WAIT);
|
||||
}
|
||||
|
||||
/* enable time slice*/
|
||||
|
|
|
@ -28,7 +28,7 @@ void test_user_k_wakeup(void)
|
|||
k_thread_create(&user_thread, ustack, STACK_SIZE, sleepy_thread,
|
||||
NULL, NULL, NULL,
|
||||
k_thread_priority_get(k_current_get()),
|
||||
K_USER | K_INHERIT_PERMS, 0);
|
||||
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
k_yield(); /* Let thread run and start sleeping forever */
|
||||
k_wakeup(&user_thread);
|
||||
|
@ -62,7 +62,7 @@ void test_user_k_is_preempt(void)
|
|||
k_thread_create(&user_thread, ustack, STACK_SIZE, preempt_test_thread,
|
||||
NULL, NULL, NULL,
|
||||
k_thread_priority_get(k_current_get()),
|
||||
K_USER | K_INHERIT_PERMS, 0);
|
||||
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
k_sem_take(&user_sem, K_FOREVER);
|
||||
|
||||
|
@ -72,7 +72,7 @@ void test_user_k_is_preempt(void)
|
|||
k_thread_create(&user_thread, ustack, STACK_SIZE, preempt_test_thread,
|
||||
NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(1),
|
||||
K_USER | K_INHERIT_PERMS, 0);
|
||||
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
k_sem_take(&user_sem, K_FOREVER);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ static void tsema_thread_thread(struct k_sem *psem)
|
|||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_entry, psem, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0),
|
||||
K_USER | K_INHERIT_PERMS, 0);
|
||||
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
zassert_false(k_sem_take(psem, K_FOREVER), NULL);
|
||||
/*clean the spawn thread avoid side effect in next TC*/
|
||||
|
|
|
@ -198,7 +198,7 @@ void test_sleep(void)
|
|||
THREAD_STACK,
|
||||
(k_thread_entry_t) test_thread,
|
||||
0, 0, NULL, TEST_THREAD_PRIORITY,
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
|
||||
TC_PRINT("Test thread started: id = %p\n", test_thread_id);
|
||||
|
||||
|
@ -206,7 +206,7 @@ void test_sleep(void)
|
|||
helper_thread_stack, THREAD_STACK,
|
||||
(k_thread_entry_t) helper_thread,
|
||||
0, 0, NULL, HELPER_THREAD_PRIORITY,
|
||||
0, 0);
|
||||
0, K_NO_WAIT);
|
||||
|
||||
TC_PRINT("Helper thread started: id = %p\n", helper_thread_id);
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ void test_spinlock_bounce(void)
|
|||
|
||||
k_thread_create(&cpu1_thread, cpu1_stack, CPU1_STACK_SIZE,
|
||||
cpu1_fn, NULL, NULL, NULL,
|
||||
0, 0, 0);
|
||||
0, 0, K_NO_WAIT);
|
||||
|
||||
k_busy_wait(10);
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ static void tstack_thread_thread(struct k_stack *pstack)
|
|||
k_tid_t tid = k_thread_create(&thread_data, threadstack, STACK_SIZE,
|
||||
tThread_entry, pstack, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), K_USER |
|
||||
K_INHERIT_PERMS, 0);
|
||||
K_INHERIT_PERMS, K_NO_WAIT);
|
||||
tstack_push(pstack);
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
|
||||
|
@ -150,7 +150,8 @@ void test_stack_alloc_thread2thread(void)
|
|||
/**TESTPOINT: thread-thread data passing via stack*/
|
||||
k_tid_t tid = k_thread_create(&thread_data, threadstack, STACK_SIZE,
|
||||
tThread_entry, &kstack_test_alloc,
|
||||
NULL, NULL, K_PRIO_PREEMPT(0), 0, 0);
|
||||
NULL, NULL, K_PRIO_PREEMPT(0), 0,
|
||||
K_NO_WAIT);
|
||||
tstack_push(&kstack_test_alloc);
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ static void test_single_stack_play(void)
|
|||
k_tid_t tid = k_thread_create(&thread_data, threadstack, TSTACK_SIZE,
|
||||
thread_entry_fn_single, &stack1, NULL,
|
||||
NULL, K_PRIO_PREEMPT(0), K_USER |
|
||||
K_INHERIT_PERMS, 0);
|
||||
K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
/* Let the child thread run */
|
||||
k_sem_take(&end_sema, K_FOREVER);
|
||||
|
@ -186,7 +186,7 @@ static void test_dual_stack_play(void)
|
|||
k_tid_t tid = k_thread_create(&thread_data, threadstack, TSTACK_SIZE,
|
||||
thread_entry_fn_dual, &stack1, &stack2,
|
||||
NULL, K_PRIO_PREEMPT(0), K_USER |
|
||||
K_INHERIT_PERMS, 0);
|
||||
K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
for (i = 0U; i < STACK_LEN; i++) {
|
||||
/* Push items to stack2 */
|
||||
|
@ -215,7 +215,7 @@ static void test_isr_stack_play(void)
|
|||
k_tid_t tid = k_thread_create(&thread_data, threadstack, TSTACK_SIZE,
|
||||
thread_entry_fn_isr, &stack1, &stack2,
|
||||
NULL, K_PRIO_PREEMPT(0),
|
||||
K_INHERIT_PERMS, 0);
|
||||
K_INHERIT_PERMS, K_NO_WAIT);
|
||||
|
||||
|
||||
/* Push items to stack2 */
|
||||
|
|
|
@ -50,7 +50,7 @@ static void create_dynamic_thread(void)
|
|||
|
||||
tid = k_thread_create(dyn_thread, dyn_thread_stack, STACKSIZE,
|
||||
dyn_thread_entry, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), K_USER, 0);
|
||||
K_PRIO_PREEMPT(0), K_USER, K_NO_WAIT);
|
||||
|
||||
k_object_access_grant(&start_sem, tid);
|
||||
k_object_access_grant(&end_sem, tid);
|
||||
|
@ -76,7 +76,7 @@ static void permission_test(void)
|
|||
|
||||
tid = k_thread_create(dyn_thread, dyn_thread_stack, STACKSIZE,
|
||||
dyn_thread_entry, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), K_USER, 0);
|
||||
K_PRIO_PREEMPT(0), K_USER, K_NO_WAIT);
|
||||
|
||||
k_object_access_grant(&start_sem, tid);
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ void test_customdata_get_set_coop(void)
|
|||
{
|
||||
k_tid_t tid = k_thread_create(&tdata_custom, tstack_custom, STACK_SIZE,
|
||||
customdata_entry, NULL, NULL, NULL,
|
||||
K_PRIO_COOP(1), 0, 0);
|
||||
K_PRIO_COOP(1), 0, K_NO_WAIT);
|
||||
|
||||
k_sleep(K_MSEC(500));
|
||||
|
||||
|
@ -130,7 +130,7 @@ void test_thread_name_get_set(void)
|
|||
/* Set and get child thread's name */
|
||||
k_tid_t tid = k_thread_create(&tdata_name, tstack_name, STACK_SIZE,
|
||||
thread_name_entry, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(1), 0, 0);
|
||||
K_PRIO_PREEMPT(1), 0, K_NO_WAIT);
|
||||
|
||||
ret = k_thread_name_set(tid, "customdata");
|
||||
zassert_equal(ret, 0, "k_thread_name_set() failed");
|
||||
|
@ -198,7 +198,7 @@ void test_thread_name_user_get_set(void)
|
|||
/* Set and get child thread's name */
|
||||
k_tid_t tid = k_thread_create(&tdata_name, tstack_name, STACK_SIZE,
|
||||
thread_name_entry, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(1), K_USER, 0);
|
||||
K_PRIO_PREEMPT(1), K_USER, K_NO_WAIT);
|
||||
ret = k_thread_name_set(tid, "customdata");
|
||||
zassert_equal(ret, 0, "k_thread_name_set() failed");
|
||||
ret = k_thread_name_copy(tid, thread_name, sizeof(thread_name));
|
||||
|
@ -223,7 +223,7 @@ void test_customdata_get_set_preempt(void)
|
|||
/** TESTPOINT: custom data of preempt thread */
|
||||
k_tid_t tid = k_thread_create(&tdata_custom, tstack_custom, STACK_SIZE,
|
||||
customdata_entry, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(0), K_USER, 0);
|
||||
K_PRIO_PREEMPT(0), K_USER, K_NO_WAIT);
|
||||
|
||||
k_sleep(K_MSEC(500));
|
||||
|
||||
|
|
|
@ -41,7 +41,8 @@ void test_essential_thread_operation(void)
|
|||
{
|
||||
k_tid_t tid = k_thread_create(&kthread_thread, kthread_stack,
|
||||
STACKSIZE, (k_thread_entry_t)thread_entry, NULL,
|
||||
NULL, NULL, K_PRIO_PREEMPT(0), 0, 0);
|
||||
NULL, NULL, K_PRIO_PREEMPT(0), 0,
|
||||
K_NO_WAIT);
|
||||
|
||||
k_sem_take(&sync_sem, K_FOREVER);
|
||||
k_thread_abort(tid);
|
||||
|
|
|
@ -62,7 +62,7 @@ void test_k_thread_foreach(void)
|
|||
/* Create new thread which should add a new entry to the thread list */
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack,
|
||||
STACK_SIZE, (k_thread_entry_t)thread_entry, NULL,
|
||||
NULL, NULL, K_PRIO_PREEMPT(0), 0, 0);
|
||||
NULL, NULL, K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
|
||||
k_sleep(K_MSEC(1));
|
||||
|
||||
/* Call k_thread_foreach() and check
|
||||
|
|
|
@ -43,7 +43,7 @@ void test_threads_abort_self(void)
|
|||
{
|
||||
execute_flag = 0;
|
||||
k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_abort,
|
||||
NULL, NULL, NULL, 0, K_USER, 0);
|
||||
NULL, NULL, NULL, 0, K_USER, K_NO_WAIT);
|
||||
k_sleep(K_MSEC(100));
|
||||
/**TESTPOINT: spawned thread executed but abort itself*/
|
||||
zassert_true(execute_flag == 1, NULL);
|
||||
|
@ -64,7 +64,7 @@ void test_threads_abort_others(void)
|
|||
execute_flag = 0;
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_entry, NULL, NULL, NULL,
|
||||
0, K_USER, 0);
|
||||
0, K_USER, K_NO_WAIT);
|
||||
|
||||
k_thread_abort(tid);
|
||||
k_sleep(K_MSEC(100));
|
||||
|
@ -73,7 +73,7 @@ void test_threads_abort_others(void)
|
|||
|
||||
tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_entry, NULL, NULL, NULL,
|
||||
0, K_USER, 0);
|
||||
0, K_USER, K_NO_WAIT);
|
||||
k_sleep(K_MSEC(50));
|
||||
k_thread_abort(tid);
|
||||
/**TESTPOINT: check running thread is aborted*/
|
||||
|
@ -93,7 +93,7 @@ void test_threads_abort_repeat(void)
|
|||
execute_flag = 0;
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_entry, NULL, NULL, NULL,
|
||||
0, K_USER, 0);
|
||||
0, K_USER, K_NO_WAIT);
|
||||
|
||||
k_thread_abort(tid);
|
||||
k_sleep(K_MSEC(100));
|
||||
|
@ -133,7 +133,7 @@ void test_abort_handler(void)
|
|||
{
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
(k_thread_entry_t)uthread_entry, NULL, NULL, NULL,
|
||||
0, 0, 0);
|
||||
0, 0, K_NO_WAIT);
|
||||
|
||||
tdata.fn_abort = &abort_function;
|
||||
|
||||
|
@ -174,7 +174,7 @@ void test_delayed_thread_abort(void)
|
|||
*/
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
(k_thread_entry_t)delayed_thread_entry, NULL, NULL, NULL,
|
||||
K_PRIO_PREEMPT(1), 0, 100);
|
||||
K_PRIO_PREEMPT(1), 0, K_MSEC(100));
|
||||
|
||||
/* Give up CPU */
|
||||
k_sleep(K_MSEC(50));
|
||||
|
|
|
@ -73,7 +73,8 @@ void test_threads_priority_set(void)
|
|||
|
||||
k_tid_t thread2_id = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
(k_thread_entry_t)thread2_set_prio_test,
|
||||
NULL, NULL, NULL, thread2_prio, 0, 0);
|
||||
NULL, NULL, NULL, thread2_prio, 0,
|
||||
K_NO_WAIT);
|
||||
|
||||
/* Lower the priority of thread2 */
|
||||
k_thread_priority_set(thread2_id, thread2_prio + 2);
|
||||
|
|
|
@ -49,7 +49,7 @@ void test_threads_spawn_params(void)
|
|||
{
|
||||
k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_params,
|
||||
tp1, INT_TO_POINTER(tp2), tp3, 0,
|
||||
K_USER, 0);
|
||||
K_USER, K_NO_WAIT);
|
||||
k_sleep(K_MSEC(100));
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ void test_threads_spawn_priority(void)
|
|||
/* spawn thread with higher priority */
|
||||
spawn_prio = k_thread_priority_get(k_current_get()) - 1;
|
||||
k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_priority,
|
||||
NULL, NULL, NULL, spawn_prio, K_USER, 0);
|
||||
NULL, NULL, NULL, spawn_prio, K_USER, K_NO_WAIT);
|
||||
k_sleep(K_MSEC(100));
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ void test_threads_spawn_delay(void)
|
|||
/* spawn thread with higher priority */
|
||||
tp2 = 10;
|
||||
k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_delay,
|
||||
NULL, NULL, NULL, 0, K_USER, 120);
|
||||
NULL, NULL, NULL, 0, K_USER, K_MSEC(120));
|
||||
/* 100 < 120 ensure spawn thread not start */
|
||||
k_sleep(K_MSEC(100));
|
||||
/* checkpoint: check spawn thread not execute */
|
||||
|
|
|
@ -26,7 +26,7 @@ static void threads_suspend_resume(int prio)
|
|||
|
||||
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
|
||||
thread_entry, NULL, NULL, NULL,
|
||||
create_prio, K_USER, 0);
|
||||
create_prio, K_USER, K_NO_WAIT);
|
||||
/* checkpoint: suspend current thread */
|
||||
k_thread_suspend(tid);
|
||||
k_sleep(K_MSEC(100));
|
||||
|
|
|
@ -117,7 +117,7 @@ static void delayed_test_items_submit(void)
|
|||
|
||||
k_thread_create(&co_op_data, co_op_stack, STACK_SIZE,
|
||||
(k_thread_entry_t)coop_work_main,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(10), 0, 0);
|
||||
NULL, NULL, NULL, K_PRIO_COOP(10), 0, K_NO_WAIT);
|
||||
|
||||
for (i = 0; i < NUM_TEST_ITEMS; i += 2) {
|
||||
TC_PRINT(" - Submitting work %d from preempt thread\n", i + 1);
|
||||
|
@ -266,7 +266,7 @@ static void test_delayed_submit(void)
|
|||
|
||||
k_thread_create(&co_op_data, co_op_stack, STACK_SIZE,
|
||||
(k_thread_entry_t)coop_delayed_work_main,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(10), 0, 0);
|
||||
NULL, NULL, NULL, K_PRIO_COOP(10), 0, K_NO_WAIT);
|
||||
|
||||
for (i = 0; i < NUM_TEST_ITEMS; i += 2) {
|
||||
TC_PRINT(" - Submitting delayed work %d from"
|
||||
|
@ -315,7 +315,7 @@ static void test_delayed_cancel(void)
|
|||
|
||||
k_thread_create(&co_op_data, co_op_stack, STACK_SIZE,
|
||||
(k_thread_entry_t)coop_delayed_work_cancel_main,
|
||||
NULL, NULL, NULL, K_HIGHEST_THREAD_PRIO, 0, 0);
|
||||
NULL, NULL, NULL, K_HIGHEST_THREAD_PRIO, 0, K_NO_WAIT);
|
||||
|
||||
TC_PRINT(" - Waiting for work to finish\n");
|
||||
k_sleep(WORK_ITEM_WAIT_ALIGNED);
|
||||
|
@ -401,7 +401,7 @@ static void test_delayed_resubmit_thread(void)
|
|||
|
||||
k_thread_create(&co_op_data, co_op_stack, STACK_SIZE,
|
||||
(k_thread_entry_t)coop_delayed_work_resubmit,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(10), 0, 0);
|
||||
NULL, NULL, NULL, K_PRIO_COOP(10), 0, K_NO_WAIT);
|
||||
|
||||
TC_PRINT(" - Waiting for work to finish\n");
|
||||
k_sleep(WORK_ITEM_WAIT_ALIGNED);
|
||||
|
|
|
@ -189,7 +189,7 @@ static void net_buf_test_3(void)
|
|||
k_thread_create(&test_3_thread_data, test_3_thread_stack,
|
||||
K_THREAD_STACK_SIZEOF(test_3_thread_stack),
|
||||
(k_thread_entry_t) test_3_thread, &fifo, &sema, NULL,
|
||||
K_PRIO_COOP(7), 0, 0);
|
||||
K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||
|
||||
zassert_true(k_sem_take(&sema, TEST_TIMEOUT) == 0,
|
||||
"Timeout while waiting for semaphore");
|
||||
|
|
|
@ -704,7 +704,7 @@ static k_tid_t start_timeout_v6_thread(s32_t timeout)
|
|||
(k_thread_entry_t)timeout_thread,
|
||||
udp_v6_ctx, INT_TO_POINTER(AF_INET6),
|
||||
INT_TO_POINTER(timeout),
|
||||
K_PRIO_COOP(7), 0, 0);
|
||||
K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||
}
|
||||
|
||||
static k_tid_t start_timeout_v4_thread(s32_t timeout)
|
||||
|
@ -713,7 +713,7 @@ static k_tid_t start_timeout_v4_thread(s32_t timeout)
|
|||
(k_thread_entry_t)timeout_thread,
|
||||
udp_v4_ctx, INT_TO_POINTER(AF_INET),
|
||||
INT_TO_POINTER(timeout),
|
||||
K_PRIO_COOP(7), 0, 0);
|
||||
K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||
}
|
||||
|
||||
static void net_ctx_recv_v6_timeout(void)
|
||||
|
|
|
@ -247,7 +247,7 @@ static void initialize_event_tests(void)
|
|||
k_thread_create(&thrower_thread_data, thrower_stack,
|
||||
K_THREAD_STACK_SIZEOF(thrower_stack),
|
||||
(k_thread_entry_t)thrower_thread,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(7), 0, 0);
|
||||
NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||
}
|
||||
|
||||
static int test_core_event(u32_t event, bool (*func)(void))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue