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:
Peter Bigot 2019-10-06 14:59:16 -05:00 committed by Anas Nashif
commit e28f330a8e
86 changed files with 201 additions and 180 deletions

View file

@ -130,7 +130,7 @@ int adt7420_init_interrupt(struct device *dev)
CONFIG_ADT7420_THREAD_STACK_SIZE, CONFIG_ADT7420_THREAD_STACK_SIZE,
(k_thread_entry_t)adt7420_thread, dev, (k_thread_entry_t)adt7420_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_ADT7420_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_ADT7420_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_ADT7420_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_ADT7420_TRIGGER_GLOBAL_THREAD)
drv_data->work.handler = adt7420_work_cb; drv_data->work.handler = adt7420_work_cb;
drv_data->dev = dev; drv_data->dev = dev;

View file

@ -160,7 +160,7 @@ int adxl362_init_interrupt(struct device *dev)
CONFIG_ADXL362_THREAD_STACK_SIZE, CONFIG_ADXL362_THREAD_STACK_SIZE,
(k_thread_entry_t)adxl362_thread, dev, (k_thread_entry_t)adxl362_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_ADXL362_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_ADXL362_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_ADXL362_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_ADXL362_TRIGGER_GLOBAL_THREAD)
drv_data->work.handler = adxl362_work_cb; drv_data->work.handler = adxl362_work_cb;
drv_data->dev = dev; drv_data->dev = dev;

View file

@ -165,7 +165,7 @@ int adxl372_init_interrupt(struct device *dev)
CONFIG_ADXL372_THREAD_STACK_SIZE, CONFIG_ADXL372_THREAD_STACK_SIZE,
(k_thread_entry_t)adxl372_thread, dev, (k_thread_entry_t)adxl372_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_ADXL372_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_ADXL372_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_ADXL372_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_ADXL372_TRIGGER_GLOBAL_THREAD)
drv_data->work.handler = adxl372_work_cb; drv_data->work.handler = adxl372_work_cb;
drv_data->dev = dev; drv_data->dev = dev;

View file

@ -183,7 +183,7 @@ int amg88xx_init_interrupt(struct device *dev)
CONFIG_AMG88XX_THREAD_STACK_SIZE, CONFIG_AMG88XX_THREAD_STACK_SIZE,
(k_thread_entry_t)amg88xx_thread, dev, (k_thread_entry_t)amg88xx_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_AMG88XX_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_AMG88XX_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_AMG88XX_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_AMG88XX_TRIGGER_GLOBAL_THREAD)
drv_data->work.handler = amg88xx_work_cb; drv_data->work.handler = amg88xx_work_cb;
drv_data->dev = dev; drv_data->dev = dev;

View file

@ -270,7 +270,7 @@ int bma280_init_interrupt(struct device *dev)
CONFIG_BMA280_THREAD_STACK_SIZE, CONFIG_BMA280_THREAD_STACK_SIZE,
(k_thread_entry_t)bma280_thread, dev, (k_thread_entry_t)bma280_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_BMA280_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_BMA280_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_BMA280_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_BMA280_TRIGGER_GLOBAL_THREAD)
drv_data->work.handler = bma280_work_cb; drv_data->work.handler = bma280_work_cb;
drv_data->dev = dev; drv_data->dev = dev;

View file

@ -126,7 +126,7 @@ int hmc5883l_init_interrupt(struct device *dev)
CONFIG_HMC5883L_THREAD_STACK_SIZE, CONFIG_HMC5883L_THREAD_STACK_SIZE,
(k_thread_entry_t)hmc5883l_thread, dev, (k_thread_entry_t)hmc5883l_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_HMC5883L_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_HMC5883L_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_HMC5883L_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_HMC5883L_TRIGGER_GLOBAL_THREAD)
drv_data->work.handler = hmc5883l_work_cb; drv_data->work.handler = hmc5883l_work_cb;
drv_data->dev = dev; drv_data->dev = dev;

View file

@ -136,7 +136,7 @@ int hts221_init_interrupt(struct device *dev)
CONFIG_HTS221_THREAD_STACK_SIZE, CONFIG_HTS221_THREAD_STACK_SIZE,
(k_thread_entry_t)hts221_thread, dev, (k_thread_entry_t)hts221_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_HTS221_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_HTS221_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_HTS221_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_HTS221_TRIGGER_GLOBAL_THREAD)
drv_data->work.handler = hts221_work_cb; drv_data->work.handler = hts221_work_cb;
drv_data->dev = dev; drv_data->dev = dev;

View file

@ -180,7 +180,7 @@ int isl29035_init_interrupt(struct device *dev)
CONFIG_ISL29035_THREAD_STACK_SIZE, CONFIG_ISL29035_THREAD_STACK_SIZE,
(k_thread_entry_t)isl29035_thread, dev, (k_thread_entry_t)isl29035_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_ISL29035_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_ISL29035_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_ISL29035_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_ISL29035_TRIGGER_GLOBAL_THREAD)
drv_data->work.handler = isl29035_work_cb; drv_data->work.handler = isl29035_work_cb;
drv_data->dev = dev; drv_data->dev = dev;

View file

@ -147,7 +147,7 @@ int lis2ds12_trigger_init(struct device *dev)
CONFIG_LIS2DS12_THREAD_STACK_SIZE, CONFIG_LIS2DS12_THREAD_STACK_SIZE,
(k_thread_entry_t)lis2ds12_thread, dev, (k_thread_entry_t)lis2ds12_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_LIS2DS12_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_LIS2DS12_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_LIS2DS12_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_LIS2DS12_TRIGGER_GLOBAL_THREAD)
data->work.handler = lis2ds12_work_cb; data->work.handler = lis2ds12_work_cb;
data->dev = dev; data->dev = dev;

View file

@ -129,7 +129,7 @@ int lis2mdl_init_interrupt(struct device *dev)
CONFIG_LIS2MDL_THREAD_STACK_SIZE, CONFIG_LIS2MDL_THREAD_STACK_SIZE,
(k_thread_entry_t)lis2mdl_thread, dev, (k_thread_entry_t)lis2mdl_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_LIS2MDL_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_LIS2MDL_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_LIS2MDL_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_LIS2MDL_TRIGGER_GLOBAL_THREAD)
lis2mdl->work.handler = lis2mdl_work_cb; lis2mdl->work.handler = lis2mdl_work_cb;
lis2mdl->dev = dev; lis2mdl->dev = dev;

View file

@ -139,7 +139,7 @@ int lis3mdl_init_interrupt(struct device *dev)
CONFIG_LIS3MDL_THREAD_STACK_SIZE, CONFIG_LIS3MDL_THREAD_STACK_SIZE,
(k_thread_entry_t)lis3mdl_thread, POINTER_TO_INT(dev), (k_thread_entry_t)lis3mdl_thread, POINTER_TO_INT(dev),
0, NULL, K_PRIO_COOP(CONFIG_LIS3MDL_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_LIS3MDL_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_LIS3MDL_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_LIS3MDL_TRIGGER_GLOBAL_THREAD)
drv_data->work.handler = lis3mdl_work_cb; drv_data->work.handler = lis3mdl_work_cb;
drv_data->dev = dev; drv_data->dev = dev;

View file

@ -137,7 +137,7 @@ int lsm6dsl_init_interrupt(struct device *dev)
CONFIG_LSM6DSL_THREAD_STACK_SIZE, CONFIG_LSM6DSL_THREAD_STACK_SIZE,
(k_thread_entry_t)lsm6dsl_thread, dev, (k_thread_entry_t)lsm6dsl_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_LSM6DSL_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_LSM6DSL_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_LSM6DSL_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_LSM6DSL_TRIGGER_GLOBAL_THREAD)
drv_data->work.handler = lsm6dsl_work_cb; drv_data->work.handler = lsm6dsl_work_cb;
drv_data->dev = dev; drv_data->dev = dev;

View file

@ -134,7 +134,7 @@ int mpu6050_init_interrupt(struct device *dev)
CONFIG_MPU6050_THREAD_STACK_SIZE, CONFIG_MPU6050_THREAD_STACK_SIZE,
(k_thread_entry_t)mpu6050_thread, dev, (k_thread_entry_t)mpu6050_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_MPU6050_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_MPU6050_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_MPU6050_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_MPU6050_TRIGGER_GLOBAL_THREAD)
drv_data->work.handler = mpu6050_work_cb; drv_data->work.handler = mpu6050_work_cb;
drv_data->dev = dev; drv_data->dev = dev;

View file

@ -223,7 +223,7 @@ int sht3xd_init_interrupt(struct device *dev)
CONFIG_SHT3XD_THREAD_STACK_SIZE, CONFIG_SHT3XD_THREAD_STACK_SIZE,
(k_thread_entry_t)sht3xd_thread, dev, (k_thread_entry_t)sht3xd_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_SHT3XD_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_SHT3XD_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_SHT3XD_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_SHT3XD_TRIGGER_GLOBAL_THREAD)
data->work.handler = sht3xd_work_cb; data->work.handler = sht3xd_work_cb;
#endif #endif

View file

@ -172,7 +172,7 @@ int tmp007_init_interrupt(struct device *dev)
CONFIG_TMP007_THREAD_STACK_SIZE, CONFIG_TMP007_THREAD_STACK_SIZE,
(k_thread_entry_t)tmp007_thread, dev, (k_thread_entry_t)tmp007_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_TMP007_THREAD_PRIORITY), 0, NULL, K_PRIO_COOP(CONFIG_TMP007_THREAD_PRIORITY),
0, 0); 0, K_NO_WAIT);
#elif defined(CONFIG_TMP007_TRIGGER_GLOBAL_THREAD) #elif defined(CONFIG_TMP007_TRIGGER_GLOBAL_THREAD)
drv_data->work.handler = tmp007_work_cb; drv_data->work.handler = tmp007_work_cb;
drv_data->dev = dev; drv_data->dev = dev;

View file

@ -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); k_queue_init(&work_q->queue);
(void)k_thread_create(&work_q->thread, stack, stack_size, z_work_q_main, (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); k_thread_name_set(&work_q->thread, WORKQUEUE_THREAD_NAME);
} }

View file

@ -339,5 +339,5 @@ void main(void)
k_thread_create(&thread_data, thread_stack, STACKSIZE, k_thread_create(&thread_data, thread_stack, STACKSIZE,
(k_thread_entry_t)listen, (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);
} }

View file

@ -252,5 +252,5 @@ void main(void)
printk("Starting application thread!\n"); printk("Starting application thread!\n");
k_thread_create(&thread_data, thread_stack, APP_TASK_STACK_SIZE, k_thread_create(&thread_data, thread_stack, APP_TASK_STACK_SIZE,
(k_thread_entry_t)app_task, (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);
} }

View file

@ -278,7 +278,7 @@ void main(void)
printk("Starting application thread!\n"); printk("Starting application thread!\n");
k_thread_create(&thread_data, thread_stack, APP_TASK_STACK_SIZE, k_thread_create(&thread_data, thread_stack, APP_TASK_STACK_SIZE,
(k_thread_entry_t)app_task, (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 /* Make sure we clear out the status flag very early (before we bringup the

View file

@ -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, K_THREAD_DEFINE(log_demo_thread_id, STACKSIZE, log_demo_supervisor,
NULL, NULL, NULL, NULL, NULL, NULL,
K_LOWEST_APPLICATION_THREAD_PRIO, 0, 1); K_LOWEST_APPLICATION_THREAD_PRIO, 0, K_MSEC(1));

View file

@ -3633,7 +3633,7 @@ void net_if_init(void)
k_thread_create(&tx_thread_ts, tx_ts_stack, k_thread_create(&tx_thread_ts, tx_ts_stack,
K_THREAD_STACK_SIZEOF(tx_ts_stack), K_THREAD_STACK_SIZEOF(tx_ts_stack),
(k_thread_entry_t)net_tx_ts_thread, (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"); k_thread_name_set(&tx_thread_ts, "tx_tstamp");
#endif /* CONFIG_NET_PKT_TIMESTAMP_THREAD */ #endif /* CONFIG_NET_PKT_TIMESTAMP_THREAD */

View file

@ -391,7 +391,8 @@ void net_mgmt_event_init(void)
k_thread_create(&mgmt_thread_data, mgmt_stack, k_thread_create(&mgmt_thread_data, mgmt_stack,
K_THREAD_STACK_SIZEOF(mgmt_stack), K_THREAD_STACK_SIZEOF(mgmt_stack),
(k_thread_entry_t)mgmt_thread, NULL, NULL, NULL, (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"); k_thread_name_set(&mgmt_thread_data, "net_mgmt");
NET_DBG("Net MGMT initialized: queue of %u entries, stack size of %u", NET_DBG("Net MGMT initialized: queue of %u entries, stack size of %u",

View file

@ -908,7 +908,7 @@ static void init_ports(void)
tid = k_thread_create(&gptp_thread_data, gptp_stack, tid = k_thread_create(&gptp_thread_data, gptp_stack,
K_THREAD_STACK_SIZEOF(gptp_stack), K_THREAD_STACK_SIZEOF(gptp_stack),
(k_thread_entry_t)gptp_thread, (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"); k_thread_name_set(&gptp_thread_data, "gptp");
} }

View file

@ -172,7 +172,7 @@ static void conn_mgr(void)
K_THREAD_DEFINE(conn_mgr_thread, CONFIG_NET_CONNECTION_MANAGER_STACK_SIZE, K_THREAD_DEFINE(conn_mgr_thread, CONFIG_NET_CONNECTION_MANAGER_STACK_SIZE,
(k_thread_entry_t)conn_mgr, NULL, NULL, NULL, (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) void net_conn_mgr_resend_status(void)
{ {

View file

@ -283,7 +283,8 @@ static int run_test(struct unit_test *test)
K_THREAD_STACK_SIZEOF(ztest_thread_stack), K_THREAD_STACK_SIZEOF(ztest_thread_stack),
(k_thread_entry_t) test_cb, (struct unit_test *)test, (k_thread_entry_t) test_cb, (struct unit_test *)test,
NULL, NULL, CONFIG_ZTEST_THREAD_PRIORITY, 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 * There is an implicit expectation here that the thread that was
* spawned is still higher priority than the current thread. * spawned is still higher priority than the current thread.

View file

@ -955,7 +955,7 @@ static int mass_storage_init(struct device *dev)
k_thread_create(&mass_thread_data, mass_thread_stack, k_thread_create(&mass_thread_data, mass_thread_stack,
DISK_THREAD_STACK_SZ, DISK_THREAD_STACK_SZ,
(k_thread_entry_t)mass_thread_main, NULL, NULL, NULL, (k_thread_entry_t)mass_thread_main, NULL, NULL, NULL,
DISK_THREAD_PRIO, 0, 0); DISK_THREAD_PRIO, 0, K_NO_WAIT);
return 0; return 0;
} }

View file

@ -105,7 +105,7 @@ void main(void)
k_tid_t th = k_thread_create(&partner_thread, partner_stack, k_tid_t th = k_thread_create(&partner_thread, partner_stack,
K_THREAD_STACK_SIZEOF(partner_stack), K_THREAD_STACK_SIZEOF(partner_stack),
partner_fn, NULL, NULL, NULL, partner_fn, NULL, NULL, NULL,
partner_prio, 0, 0); partner_prio, 0, K_NO_WAIT);
/* Let it start running and pend */ /* Let it start running and pend */
k_sleep(K_MSEC(100)); k_sleep(K_MSEC(100));

View file

@ -129,7 +129,7 @@ void msg_passing_bench(void)
producer_w_cxt_switch_tid = producer_w_cxt_switch_tid =
k_thread_create(&my_thread, my_stack_area, STACK_SIZE, k_thread_create(&my_thread, my_stack_area, STACK_SIZE,
thread_producer_msgq_w_cxt_switch, NULL, 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, u32_t msg_status = k_msgq_get(&benchmark_q, &received_data,
K_MSEC(300)); K_MSEC(300));
@ -137,7 +137,8 @@ void msg_passing_bench(void)
producer_wo_cxt_switch_tid = producer_wo_cxt_switch_tid =
k_thread_create(&my_thread_0, my_stack_area_0, STACK_SIZE, k_thread_create(&my_thread_0, my_stack_area_0, STACK_SIZE,
thread_producer_msgq_wo_cxt_switch, 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_w_cxt_switch_tid);
k_thread_abort(producer_wo_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, k_thread_create(&my_thread, my_stack_area,
STACK_SIZE, STACK_SIZE,
thread_producer_get_msgq_w_cxt_switch, NULL, 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 = consumer_get_w_cxt_switch_tid =
k_thread_create(&my_thread_0, my_stack_area_0, k_thread_create(&my_thread_0, my_stack_area_0,
STACK_SIZE, STACK_SIZE,
thread_consumer_get_msgq_w_cxt_switch, thread_consumer_get_msgq_w_cxt_switch,
NULL, NULL, NULL, NULL, NULL, NULL,
2 /*priority*/, 0, 50); 2 /*priority*/, 0, K_MSEC(50));
k_sleep(K_MSEC(2000)); /* make the main thread sleep */ k_sleep(K_MSEC(2000)); /* make the main thread sleep */
k_thread_abort(producer_get_w_cxt_switch_tid); k_thread_abort(producer_get_w_cxt_switch_tid);
__msg_q_get_w_cxt_end_time = (z_arch_timing_value_swap_common); __msg_q_get_w_cxt_end_time = (z_arch_timing_value_swap_common);
@ -187,13 +188,13 @@ void msg_passing_bench(void)
STACK_SIZE, STACK_SIZE,
thread_mbox_sync_put_send, thread_mbox_sync_put_send,
NULL, NULL, NULL, NULL, NULL, NULL,
2 /*priority*/, 0, 0); 2 /*priority*/, 0, K_NO_WAIT);
thread_mbox_sync_put_receive_tid = thread_mbox_sync_put_receive_tid =
k_thread_create(&my_thread_0, my_stack_area_0, k_thread_create(&my_thread_0, my_stack_area_0,
STACK_SIZE, STACK_SIZE,
thread_mbox_sync_put_receive, thread_mbox_sync_put_receive,
NULL, NULL, NULL, NULL, NULL, NULL,
1 /*priority*/, 0, 0); 1 /*priority*/, 0, K_NO_WAIT);
k_sleep(K_MSEC(1000)); /* make the main thread sleep */ k_sleep(K_MSEC(1000)); /* make the main thread sleep */
mbox_sync_put_end_time = (z_arch_timing_value_swap_common); mbox_sync_put_end_time = (z_arch_timing_value_swap_common);
@ -206,12 +207,12 @@ void msg_passing_bench(void)
STACK_SIZE, STACK_SIZE,
thread_mbox_sync_get_send, thread_mbox_sync_get_send,
NULL, NULL, NULL, NULL, NULL, NULL,
1 /*prio*/, 0, 0); 1 /*prio*/, 0, K_NO_WAIT);
thread_mbox_sync_get_receive_tid = thread_mbox_sync_get_receive_tid =
k_thread_create(&my_thread_0, my_stack_area_0, k_thread_create(&my_thread_0, my_stack_area_0,
STACK_SIZE, STACK_SIZE,
thread_mbox_sync_get_receive, NULL, 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 */ k_sleep(K_MSEC(1000)); /* make the main thread sleep */
mbox_sync_get_end_time = (z_arch_timing_value_swap_common); mbox_sync_get_end_time = (z_arch_timing_value_swap_common);
@ -224,13 +225,13 @@ void msg_passing_bench(void)
STACK_SIZE, STACK_SIZE,
thread_mbox_async_put_send, thread_mbox_async_put_send,
NULL, NULL, NULL, NULL, NULL, NULL,
2 /*prio*/, 0, 0); 2 /*prio*/, 0, K_NO_WAIT);
thread_mbox_async_put_receive_tid = thread_mbox_async_put_receive_tid =
k_thread_create(&my_thread_0, my_stack_area_0, k_thread_create(&my_thread_0, my_stack_area_0,
STACK_SIZE, STACK_SIZE,
thread_mbox_async_put_receive, thread_mbox_async_put_receive,
NULL, NULL, NULL, NULL, NULL, NULL,
3 /*priority*/, 0, 0); 3 /*priority*/, 0, K_NO_WAIT);
k_sleep(K_MSEC(1000)); /* make the main thread sleep */ k_sleep(K_MSEC(1000)); /* make the main thread sleep */
/*******************************************************************/ /*******************************************************************/

View file

@ -54,11 +54,11 @@ void semaphore_bench(void)
sem0_tid = k_thread_create(&my_thread, my_stack_area, sem0_tid = k_thread_create(&my_thread, my_stack_area,
STACK_SIZE, STACK_SIZE,
thread_sem0_test, NULL, NULL, NULL, 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, sem1_tid = k_thread_create(&my_thread_0, my_stack_area_0,
STACK_SIZE, thread_sem1_test, STACK_SIZE, thread_sem1_test,
NULL, NULL, NULL, NULL, NULL, NULL,
2 /*priority*/, 0, 0); 2 /*priority*/, 0, K_NO_WAIT);
k_sleep(K_MSEC(1000)); k_sleep(K_MSEC(1000));
@ -70,11 +70,11 @@ void semaphore_bench(void)
sem0_tid = k_thread_create(&my_thread, my_stack_area, sem0_tid = k_thread_create(&my_thread, my_stack_area,
STACK_SIZE, thread_sem0_give_test, STACK_SIZE, thread_sem0_give_test,
NULL, NULL, NULL, 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, sem1_tid = k_thread_create(&my_thread_0, my_stack_area_0,
STACK_SIZE, thread_sem1_give_test, STACK_SIZE, thread_sem1_give_test,
NULL, NULL, NULL, NULL, NULL, NULL,
2 /*priority*/, 0, 0); 2 /*priority*/, 0, K_NO_WAIT);
k_sleep(K_MSEC(1000)); k_sleep(K_MSEC(1000));
sem_give_end_time = (z_arch_timing_value_swap_common); sem_give_end_time = (z_arch_timing_value_swap_common);

View file

@ -139,7 +139,7 @@ void system_thread_bench(void)
k_thread_create(&my_thread_0, my_stack_area_0, STACK_SIZE, k_thread_create(&my_thread_0, my_stack_area_0, STACK_SIZE,
thread_swap_test, thread_swap_test,
NULL, NULL, NULL, NULL, NULL, NULL,
-1 /*priority*/, 0, 0); -1 /*priority*/, 0, K_NO_WAIT);
k_sleep(K_MSEC(1)); k_sleep(K_MSEC(1));
thread_abort_end_time = (z_arch_timing_value_swap_common); thread_abort_end_time = (z_arch_timing_value_swap_common);
@ -166,7 +166,7 @@ void system_thread_bench(void)
STACK_SIZE, STACK_SIZE,
thread_swap_test, thread_swap_test,
NULL, NULL, NULL, NULL, NULL, NULL,
5 /*priority*/, 0, 10); 5 /*priority*/, 0, K_MSEC(10));
TIMING_INFO_PRE_READ(); TIMING_INFO_PRE_READ();
thread_create_end_time = TIMING_INFO_OS_GET_TIME(); thread_create_end_time = TIMING_INFO_OS_GET_TIME();
@ -183,7 +183,7 @@ void system_thread_bench(void)
STACK_SIZE, STACK_SIZE,
thread_suspend_test, thread_suspend_test,
NULL, NULL, NULL, NULL, NULL, NULL,
-1 /*priority*/, 0, 0); -1 /*priority*/, 0, K_NO_WAIT);
TIMING_INFO_PRE_READ(); TIMING_INFO_PRE_READ();
thread_suspend_end_time = TIMING_INFO_OS_GET_TIME(); thread_suspend_end_time = TIMING_INFO_OS_GET_TIME();

View file

@ -100,7 +100,7 @@ void drop_to_user_mode(void)
k_thread_create(&my_thread_user, my_stack_area_0, STACK_SIZE, k_thread_create(&my_thread_user, my_stack_area_0, STACK_SIZE,
drop_to_user_mode_thread, drop_to_user_mode_thread,
NULL, NULL, NULL, NULL, NULL, NULL,
-1 /*priority*/, K_INHERIT_PERMS, 0); -1 /*priority*/, K_INHERIT_PERMS, K_NO_WAIT);
k_yield(); k_yield();
@ -135,7 +135,7 @@ void user_thread_creation(void)
k_thread_create(&my_thread_user, my_stack_area, STACK_SIZE, k_thread_create(&my_thread_user, my_stack_area, STACK_SIZE,
test_drop_to_user_mode_1, test_drop_to_user_mode_1,
NULL, NULL, NULL, 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(); TIMING_INFO_PRE_READ();
user_thread_creation_end_time = TIMING_INFO_GET_TIMER_VALUE(); 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, k_thread_create(&my_thread_user, my_stack_area_0, STACK_SIZE,
syscall_overhead_user_thread, syscall_overhead_user_thread,
NULL, NULL, NULL, 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) 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, k_thread_create(&my_thread_user, my_stack_area, STACK_SIZE,
validation_overhead_user_thread, validation_overhead_user_thread,
NULL, NULL, NULL, 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) u32_t total_cycles_obj_init = (u32_t)

View file

@ -39,13 +39,13 @@ void yield_bench(void)
STACK_SIZE, STACK_SIZE,
thread_yield0_test, thread_yield0_test,
NULL, NULL, NULL, 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, yield1_tid = k_thread_create(&my_thread_0, my_stack_area_0,
STACK_SIZE, STACK_SIZE,
thread_yield1_test, thread_yield1_test,
NULL, NULL, NULL, 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 */ /*read the time of start of the sleep till the swap happens */
z_arch_timing_value_swap_end = 1U; z_arch_timing_value_swap_end = 1U;

View file

@ -445,7 +445,7 @@ void testing_spi(void)
spi_async_stack, STACK_SIZE, spi_async_stack, STACK_SIZE,
(k_thread_entry_t)spi_async_call_cb, (k_thread_entry_t)spi_async_call_cb,
&async_evt, &caller, NULL, &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) || if (spi_complete_loop(spi_slow, &spi_cfg_slow) ||
spi_rx_half_start(spi_slow, &spi_cfg_slow) || spi_rx_half_start(spi_slow, &spi_cfg_slow) ||

View file

@ -56,7 +56,7 @@ void test_timeout_order(void)
for (ii = 0; ii < NUM_TIMEOUTS; ii++) { for (ii = 0; ii < NUM_TIMEOUTS; ii++) {
(void)k_thread_create(&threads[ii], stacks[ii], STACKSIZE, (void)k_thread_create(&threads[ii], stacks[ii], STACKSIZE,
thread, INT_TO_POINTER(ii), 0, 0, thread, INT_TO_POINTER(ii), 0, 0,
prio, 0, 0); prio, 0, K_NO_WAIT);
k_timer_init(&timer[ii], 0, 0); k_timer_init(&timer[ii], 0, 0);
k_sem_init(&sem[ii], 0, 1); k_sem_init(&sem[ii], 0, 1);
results[ii] = -1; results[ii] = -1;

View file

@ -579,7 +579,7 @@ static void k_yield_entry(void *arg0, void *arg1, void *arg2)
k_thread_create(&thread_data2, thread_stack2, THREAD_STACKSIZE, k_thread_create(&thread_data2, thread_stack2, THREAD_STACKSIZE,
thread_helper, NULL, NULL, NULL, 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, zassert_equal(thread_evidence, 0,
"Helper created at higher priority ran prematurely."); "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], k_thread_create(&timeout_threads[0], timeout_stacks[0],
THREAD_STACKSIZE2, busy_wait_thread, THREAD_STACKSIZE2, busy_wait_thread,
INT_TO_POINTER(timeout), NULL, 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); 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], k_thread_create(&timeout_threads[0], timeout_stacks[0],
THREAD_STACKSIZE2, thread_sleep, THREAD_STACKSIZE2, thread_sleep,
INT_TO_POINTER(timeout), NULL, 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); rv = k_sem_take(&reply_timeout, timeout * 2);
zassert_equal(rv, 0, " *** thread timed out waiting for thread on " 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_thread_create(&thread_data1, thread_stack1, THREAD_STACKSIZE,
k_yield_entry, NULL, NULL, 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, zassert_equal(thread_evidence, 1,
"Thread did not execute as expected!: %d", thread_evidence); "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, k_thread_create(&thread_data3, thread_stack3, THREAD_STACKSIZE,
kernel_thread_entry, NULL, NULL, kernel_thread_entry, NULL, NULL,
NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, 0); NULL, K_PRIO_COOP(THREAD_PRIORITY), 0, K_NO_WAIT);
} }

View file

@ -196,11 +196,11 @@ static void start_threads(void)
{ {
k_thread_create(&thread1, stack1, STACK_SIZE, k_thread_create(&thread1, stack1, STACK_SIZE,
alternate_thread, NULL, NULL, NULL, 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, k_thread_create(&thread2, stack2, STACK_SIZE,
regression_thread, NULL, NULL, NULL, regression_thread, NULL, NULL, NULL,
K_PRIO_PREEMPT(12), 0, 0); K_PRIO_PREEMPT(12), 0, K_NO_WAIT);
} }
/** /**

View file

@ -112,7 +112,7 @@ static void test_early_sleep(void)
helper_tstack, THREAD_STACK, helper_tstack, THREAD_STACK,
helper_thread, NULL, NULL, NULL, helper_thread, NULL, NULL, NULL,
k_thread_priority_get(k_current_get()) + 1, 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", TC_PRINT("k_sleep() ticks at POST_KERNEL level: %d\n",
actual_post_kernel_sleep_ticks); actual_post_kernel_sleep_ticks);

View file

@ -26,7 +26,7 @@ static void tfifo_thread_thread(struct k_fifo *pfifo)
{ {
k_tid_t tid = k_thread_create(&thread, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&thread, tstack, STACK_SIZE,
t_cancel_wait_entry, pfifo, NULL, NULL, 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(); u32_t start_t = k_uptime_get_32();
void *ret = k_fifo_get(pfifo, 500); void *ret = k_fifo_get(pfifo, 500);
u32_t dur = k_uptime_get_32() - start_t; u32_t dur = k_uptime_get_32() - start_t;

View file

@ -90,7 +90,7 @@ static void tfifo_thread_thread(struct k_fifo *pfifo)
/**TESTPOINT: thread-thread data passing via fifo*/ /**TESTPOINT: thread-thread data passing via fifo*/
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_entry, pfifo, NULL, NULL, tThread_entry, pfifo, NULL, NULL,
K_PRIO_PREEMPT(0), 0, 0); K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
tfifo_put(pfifo); tfifo_put(pfifo);
k_sem_take(&end_sema, K_FOREVER); k_sem_take(&end_sema, K_FOREVER);
k_thread_abort(tid); k_thread_abort(tid);

View file

@ -62,7 +62,7 @@ static void tfifo_read_write(struct k_fifo *pfifo)
/**TESTPOINT: thread-isr-thread data passing via fifo*/ /**TESTPOINT: thread-isr-thread data passing via fifo*/
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_entry, pfifo, NULL, NULL, tThread_entry, pfifo, NULL, NULL,
K_PRIO_PREEMPT(0), 0, 0); K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
TC_PRINT("main fifo put ---> "); TC_PRINT("main fifo put ---> ");
tfifo_put(pfifo); tfifo_put(pfifo);

View file

@ -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, tid[ii] = k_thread_create(&ttdata[ii], ttstack[ii], TSTACK_SIZE,
test_thread_pend_and_timeout, test_thread_pend_and_timeout,
&test_data[ii], NULL, NULL, &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 /* 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, tid[ii] = k_thread_create(&ttdata[ii], ttstack[ii], TSTACK_SIZE,
test_thread_pend_and_get_data, test_thread_pend_and_get_data,
&test_data[ii], NULL, NULL, &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, tid[ii] = k_thread_create(&ttdata[ii], ttstack[ii], TSTACK_SIZE,
test_thread_pend_and_timeout, test_thread_pend_and_timeout,
&test_data[ii], NULL, NULL, &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++) { for (ii = 0; ii < test_data_size-1; ii++) {
k_fifo_put(test_data[ii].fifo, get_scratch_packet()); 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, tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
test_thread_put_timeout, &fifo_timeout[0], test_thread_put_timeout, &fifo_timeout[0],
&timeout, NULL, &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); packet = k_fifo_get(&fifo_timeout[0], timeout + 10);
zassert_true(packet != NULL, NULL); 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, tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
test_thread_timeout_reply_values, test_thread_timeout_reply_values,
&reply_packet, NULL, NULL, &reply_packet, NULL, NULL,
FIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); FIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT);
k_yield(); k_yield();
packet = k_fifo_get(&timeout_order_fifo, K_NO_WAIT); 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, tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
test_thread_timeout_reply_values, test_thread_timeout_reply_values,
&reply_packet, NULL, NULL, &reply_packet, NULL, NULL,
FIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); FIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT);
k_yield(); k_yield();
packet = k_fifo_get(&timeout_order_fifo, K_NO_WAIT); 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, tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
test_thread_timeout_reply_values_wfe, test_thread_timeout_reply_values_wfe,
&reply_packet, NULL, NULL, &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); packet = k_fifo_get(&timeout_order_fifo, K_FOREVER);
zassert_true(packet != NULL, NULL); zassert_true(packet != NULL, NULL);

View file

@ -156,7 +156,7 @@ static void test_single_fifo_play(void)
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_entry_fn_single, &fifo1, NULL, NULL, 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 */ /* Let the child thread run */
k_sem_take(&end_sema, K_FOREVER); 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, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_entry_fn_dual, &fifo1, &fifo2, NULL, 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++) { for (i = 0U; i < LIST_LEN; i++) {
/* Put item into fifo */ /* 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, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_entry_fn_isr, &fifo1, &fifo2, NULL, 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 */ /* Put item into fifo */

View file

@ -61,7 +61,7 @@ static void tlifo_thread_thread(struct k_lifo *plifo)
/**TESTPOINT: thread-thread data passing via lifo*/ /**TESTPOINT: thread-thread data passing via lifo*/
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_entry, plifo, NULL, NULL, tThread_entry, plifo, NULL, NULL,
K_PRIO_PREEMPT(0), 0, 0); K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
tlifo_put(plifo); tlifo_put(plifo);
k_sem_take(&end_sema, K_FOREVER); k_sem_take(&end_sema, K_FOREVER);
k_thread_abort(tid); k_thread_abort(tid);

View file

@ -62,7 +62,7 @@ static void tlifo_read_write(struct k_lifo *plifo)
/**TESTPOINT: thread-isr-thread data passing via lifo*/ /**TESTPOINT: thread-isr-thread data passing via lifo*/
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_entry, plifo, NULL, NULL, tThread_entry, plifo, NULL, NULL,
K_PRIO_PREEMPT(0), 0, 0); K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
TC_PRINT("main lifo put ---> "); TC_PRINT("main lifo put ---> ");
tlifo_put(plifo); tlifo_put(plifo);

View file

@ -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, tid[ii] = k_thread_create(&ttdata[ii], ttstack[ii], TSTACK_SIZE,
test_thread_pend_and_timeout, test_thread_pend_and_timeout,
&test_data[ii], NULL, NULL, &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++) { 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, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_entry_nowait, &lifo, NULL, NULL, 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]); 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, k_tid_t tid = k_thread_create(&tdata1, tstack1, STACK_SIZE,
thread_entry_wait, &plifo, NULL, NULL, 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); 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, tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
test_thread_put_timeout, &lifo_timeout[0], test_thread_put_timeout, &lifo_timeout[0],
&timeout, NULL, &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); packet = k_lifo_get(&lifo_timeout[0], timeout + 10);
zassert_true(packet != NULL, NULL); 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, tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
test_thread_timeout_reply_values, test_thread_timeout_reply_values,
&reply_packet, NULL, NULL, &reply_packet, NULL, NULL,
LIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); LIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT);
k_yield(); k_yield();
packet = k_lifo_get(&timeout_order_lifo, K_NO_WAIT); 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, tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
test_thread_timeout_reply_values, test_thread_timeout_reply_values,
&reply_packet, NULL, NULL, &reply_packet, NULL, NULL,
LIFO_THREAD_PRIO, K_INHERIT_PERMS, 0); LIFO_THREAD_PRIO, K_INHERIT_PERMS, K_NO_WAIT);
k_yield(); k_yield();
packet = k_lifo_get(&timeout_order_lifo, K_NO_WAIT); 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, tid[0] = k_thread_create(&ttdata[0], ttstack[0], TSTACK_SIZE,
test_thread_timeout_reply_values_wfe, test_thread_timeout_reply_values_wfe,
&reply_packet, NULL, NULL, &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); packet = k_lifo_get(&timeout_order_lifo, K_FOREVER);
zassert_true(packet != NULL, NULL); zassert_true(packet != NULL, NULL);

View file

@ -538,7 +538,7 @@ static void tmbox(struct k_mbox *pmbox)
sender_tid = k_current_get(); sender_tid = k_current_get();
receiver_tid = k_thread_create(&tdata, tstack, STACK_SIZE, receiver_tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tmbox_entry, pmbox, NULL, NULL, tmbox_entry, pmbox, NULL, NULL,
K_PRIO_PREEMPT(0), 0, 0); K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
tmbox_put(pmbox); tmbox_put(pmbox);
k_sem_take(&end_sema, K_FOREVER); k_sem_take(&end_sema, K_FOREVER);

View file

@ -70,15 +70,15 @@ void test_mpool_alloc_wait_prio(void)
/*the low-priority thread*/ /*the low-priority thread*/
tid[0] = k_thread_create(&tdata[0], tstack[0], STACK_SIZE, tid[0] = k_thread_create(&tdata[0], tstack[0], STACK_SIZE,
tmpool_alloc_wait_timeout, NULL, NULL, NULL, 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*/ /*the highest-priority thread that has waited the longest*/
tid[1] = k_thread_create(&tdata[1], tstack[1], STACK_SIZE, tid[1] = k_thread_create(&tdata[1], tstack[1], STACK_SIZE,
tmpool_alloc_wait_ok, NULL, NULL, NULL, 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*/ /*the highest-priority thread that has waited shorter*/
tid[2] = k_thread_create(&tdata[2], tstack[2], STACK_SIZE, tid[2] = k_thread_create(&tdata[2], tstack[2], STACK_SIZE,
tmpool_alloc_wait_timeout, NULL, NULL, NULL, 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 */ /*relinquish CPU for above threads to start */
k_sleep(K_MSEC(30)); k_sleep(K_MSEC(30));
/*free one block, expected to unblock thread "tid[1]"*/ /*free one block, expected to unblock thread "tid[1]"*/

View file

@ -74,7 +74,7 @@ void test_mpool_threadsafe(void)
for (int i = 0; i < THREAD_NUM; i++) { for (int i = 0; i < THREAD_NUM; i++) {
tid[i] = k_thread_create(&tdata[i], tstack[i], STACK_SIZE, tid[i] = k_thread_create(&tdata[i], tstack[i], STACK_SIZE,
tmpool_api, NULL, NULL, NULL, 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*/ /* TESTPOINT: all threads complete and exit the entry function*/
for (int i = 0; i < THREAD_NUM; i++) { for (int i = 0; i < THREAD_NUM; i++) {

View file

@ -72,15 +72,15 @@ void test_mslab_alloc_wait_prio(void)
/*the low-priority thread*/ /*the low-priority thread*/
tid[0] = k_thread_create(&tdata[0], tstack[0], STACK_SIZE, tid[0] = k_thread_create(&tdata[0], tstack[0], STACK_SIZE,
tmslab_alloc_wait_timeout, NULL, NULL, NULL, 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*/ /*the highest-priority thread that has waited the longest*/
tid[1] = k_thread_create(&tdata[1], tstack[1], STACK_SIZE, tid[1] = k_thread_create(&tdata[1], tstack[1], STACK_SIZE,
tmslab_alloc_wait_ok, NULL, NULL, NULL, 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*/ /*the highest-priority thread that has waited shorter*/
tid[2] = k_thread_create(&tdata[2], tstack[2], STACK_SIZE, tid[2] = k_thread_create(&tdata[2], tstack[2], STACK_SIZE,
tmslab_alloc_wait_timeout, NULL, NULL, NULL, 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 */ /*relinquish CPU for above threads to start */
k_sleep(K_MSEC(30)); k_sleep(K_MSEC(30));
/*free one block, expected to unblock thread "tid[1]"*/ /*free one block, expected to unblock thread "tid[1]"*/

View file

@ -81,7 +81,7 @@ void test_mslab_threadsafe(void)
for (int i = 0; i < THREAD_NUM; i++) { for (int i = 0; i < THREAD_NUM; i++) {
tid[i] = k_thread_create(&tdata[i], tstack[i], STACK_SIZE, tid[i] = k_thread_create(&tdata[i], tstack[i], STACK_SIZE,
tmslab_api, NULL, NULL, NULL, 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*/ /* TESTPOINT: all threads complete and exit the entry function*/
for (int i = 0; i < THREAD_NUM; i++) { for (int i = 0; i < THREAD_NUM; i++) {

View file

@ -96,7 +96,7 @@ static void msgq_thread(struct k_msgq *pmsgq)
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_entry, pmsgq, NULL, NULL, thread_entry, pmsgq, NULL, NULL,
K_PRIO_PREEMPT(0), K_PRIO_PREEMPT(0),
K_USER | K_INHERIT_PERMS, 0); K_USER | K_INHERIT_PERMS, K_NO_WAIT);
put_msgq(pmsgq); put_msgq(pmsgq);
k_sem_take(&end_sema, K_FOREVER); k_sem_take(&end_sema, K_FOREVER);
k_thread_abort(tid); 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, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_entry_overflow, pmsgq, NULL, NULL, thread_entry_overflow, pmsgq, NULL, NULL,
K_PRIO_PREEMPT(0), 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); 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, k_tid_t tid = k_thread_create(&tdata2, tstack2, STACK_SIZE,
pend_thread_entry, pmsgq, NULL, 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, k_tid_t tid1 = k_thread_create(&tdata1, tstack1, STACK_SIZE,
thread_entry_get_data, pmsgq, NULL, 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_sem_take(&end_sema, K_FOREVER);
k_thread_abort(tid); k_thread_abort(tid);

View file

@ -31,7 +31,8 @@ static void purge_when_put(struct k_msgq *q)
/*create another thread waiting to put msg*/ /*create another thread waiting to put msg*/
k_thread_create(&tdata, tstack, STACK_SIZE, k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_entry, q, NULL, NULL, 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); k_sleep(TIMEOUT >> 1);
/**TESTPOINT: msgq purge while another thread waiting to put msg*/ /**TESTPOINT: msgq purge while another thread waiting to put msg*/
k_msgq_purge(q); k_msgq_purge(q);

View file

@ -48,7 +48,7 @@ static void tmutex_test_lock(struct k_mutex *pmutex,
k_thread_create(&tdata, tstack, STACK_SIZE, k_thread_create(&tdata, tstack, STACK_SIZE,
entry_fn, pmutex, NULL, NULL, entry_fn, pmutex, NULL, NULL,
K_PRIO_PREEMPT(0), K_PRIO_PREEMPT(0),
K_USER | K_INHERIT_PERMS, 0); K_USER | K_INHERIT_PERMS, K_NO_WAIT);
k_mutex_lock(pmutex, K_FOREVER); k_mutex_lock(pmutex, K_FOREVER);
TC_PRINT("access resource from main thread\n"); 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, k_thread_create(&tdata, tstack, STACK_SIZE,
entry_fn, pmutex, NULL, NULL, entry_fn, pmutex, NULL, NULL,
K_PRIO_PREEMPT(0), K_PRIO_PREEMPT(0),
K_USER | K_INHERIT_PERMS, 0); K_USER | K_INHERIT_PERMS, K_NO_WAIT);
k_mutex_lock(pmutex, K_FOREVER); k_mutex_lock(pmutex, K_FOREVER);
TC_PRINT("access resource from main thread\n"); TC_PRINT("access resource from main thread\n");

View file

@ -249,10 +249,12 @@ void task_high(void)
counter = SEM_TEST_START; counter = SEM_TEST_START;
k_thread_create(&coop_thread[0], coop_stack[0], COOP_STACKSIZE, 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, 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; counter = FIFO_TEST_START;
fifo_tests(THIRD_SECOND, &task_high_state, my_fifo_get, k_sem_take); fifo_tests(THIRD_SECOND, &task_high_state, my_fifo_get, k_sem_take);

View file

@ -701,7 +701,8 @@ void test_pipe_on_single_elements(void)
k_thread_create(&get_single_tid, stack_1, STACK_SIZE, k_thread_create(&get_single_tid, stack_1, STACK_SIZE,
pipe_get_single, NULL, NULL, NULL, 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(); pipe_put_single();
k_sem_take(&sync_sem, K_FOREVER); 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, k_thread_create(&get_single_tid, stack_1, STACK_SIZE,
pipe_get_multiple, NULL, NULL, NULL, 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(); pipe_put_multiple();
k_sem_take(&sync_sem, K_FOREVER); 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, k_thread_create(&get_single_tid, stack_1, STACK_SIZE,
pipe_get_forever_wait, NULL, NULL, NULL, 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(); pipe_put_forever_wait();
k_sem_take(&sync_sem, K_FOREVER); 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, k_thread_create(&get_single_tid, stack_1, STACK_SIZE,
pipe_get_timeout, NULL, NULL, NULL, 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(); pipe_put_timeout();
k_sem_take(&sync_sem, K_FOREVER); 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, k_thread_create(&get_single_tid, stack_1, STACK_SIZE,
pipe_get_forever_timeout, NULL, NULL, NULL, 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(); pipe_put_forever_timeout();
k_sem_take(&sync_sem, K_FOREVER); k_sem_take(&sync_sem, K_FOREVER);

View file

@ -106,7 +106,7 @@ static void tpipe_thread_thread(struct k_pipe *ppipe)
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_entry, ppipe, NULL, NULL, tThread_entry, ppipe, NULL, NULL,
K_PRIO_PREEMPT(0), K_PRIO_PREEMPT(0),
K_INHERIT_PERMS | K_USER, 0); K_INHERIT_PERMS | K_USER, K_NO_WAIT);
tpipe_put(ppipe, K_NO_WAIT); tpipe_put(ppipe, K_NO_WAIT);
k_sem_take(&end_sema, K_FOREVER); 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*/ /**TESTPOINT: thread-thread data passing via pipe*/
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_entry, ppipe, NULL, NULL, 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); tpipe_put(ppipe, K_NO_WAIT);
k_sem_take(&end_sema, K_FOREVER); 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*/ /**TESTPOINT: test k_pipe_block_put without semaphore*/
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_block_put, &kpipe, NULL, NULL, 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)); k_sleep(K_MSEC(10));
tpipe_get(&kpipe, K_FOREVER); tpipe_get(&kpipe, K_FOREVER);
@ -231,7 +231,7 @@ void test_pipe_block_put_sema(void)
/**TESTPOINT: test k_pipe_block_put with semaphore*/ /**TESTPOINT: test k_pipe_block_put with semaphore*/
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_block_put, &pipe, &sync_sema, 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)); k_sleep(K_MSEC(10));
tpipe_get(&pipe, K_FOREVER); tpipe_get(&pipe, K_FOREVER);
k_sem_take(&end_sema, 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]*/ /**TESTPOINT: test API sequence: [get, put]*/
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_block_put, &kpipe, NULL, NULL, 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*/ /*get will be executed previous to put*/
tpipe_get(&kpipe, K_FOREVER); 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, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_half_pipe_put, &khalfpipe, tThread_half_pipe_put, &khalfpipe,
NULL, NULL, K_PRIO_PREEMPT(0), 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); 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, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_half_pipe_block_put, tThread_half_pipe_block_put,
&khalfpipe, &sync_sema, NULL, &khalfpipe, &sync_sema, NULL,
K_PRIO_PREEMPT(0), 0, 0); K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
k_sleep(K_MSEC(10)); k_sleep(K_MSEC(10));
tpipe_get(&khalfpipe, K_FOREVER); tpipe_get(&khalfpipe, K_FOREVER);
@ -352,7 +352,7 @@ void test_pipe_reader_wait(void)
/**TESTPOINT: test k_pipe_block_put with semaphore*/ /**TESTPOINT: test k_pipe_block_put with semaphore*/
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_handler, &kpipe1, NULL, NULL, thread_handler, &kpipe1, NULL, NULL,
K_PRIO_PREEMPT(0), 0, 0); K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
tpipe_get(&kpipe1, K_FOREVER); tpipe_get(&kpipe1, K_FOREVER);
k_sem_take(&end_sema, 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, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_for_block_put, &kpipe1, &s_sema, thread_for_block_put, &kpipe1, &s_sema,
NULL, K_PRIO_PREEMPT(main_low_prio - 1), 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, k_tid_t tid1 = k_thread_create(&tdata1, tstack1, STACK_SIZE,
thread_for_block_put, &kpipe1, &s_sema1, thread_for_block_put, &kpipe1, &s_sema1,
NULL, K_PRIO_PREEMPT(main_low_prio - 1), NULL, K_PRIO_PREEMPT(main_low_prio - 1),
0, 0); 0, K_NO_WAIT);
tpipe_get(&kpipe1, K_FOREVER); tpipe_get(&kpipe1, K_FOREVER);
k_thread_priority_set(k_current_get(), old_prio); k_thread_priority_set(k_current_get(), old_prio);

View file

@ -210,7 +210,8 @@ void test_poll_wait(void)
k_thread_create(&test_thread, test_stack, k_thread_create(&test_thread, test_stack,
K_THREAD_STACK_SIZEOF(test_stack), K_THREAD_STACK_SIZEOF(test_stack),
poll_wait_helper, (void *)1, 0, 0, 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)); 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_create(&test_thread, test_stack,
K_THREAD_STACK_SIZEOF(test_stack), K_THREAD_STACK_SIZEOF(test_stack),
poll_wait_helper, 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)); 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), K_THREAD_STACK_SIZEOF(test_stack),
poll_wait_helper, poll_wait_helper,
(void *)1, 0, 0, old_prio + 1, (void *)1, 0, 0, old_prio + 1,
K_USER | K_INHERIT_PERMS, 0); K_USER | K_INHERIT_PERMS, K_NO_WAIT);
/* semaphore */ /* semaphore */
rc = k_poll(wait_events, ARRAY_SIZE(wait_events), K_SECONDS(1)); 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_create(&test_thread, test_stack,
K_THREAD_STACK_SIZEOF(test_stack), K_THREAD_STACK_SIZEOF(test_stack),
poll_cancel_helper, (void *)1, 0, 0, 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)); 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_create(&test_thread, test_stack,
K_THREAD_STACK_SIZEOF(test_stack), K_THREAD_STACK_SIZEOF(test_stack),
multi, 0, 0, 0, main_low_prio - 1, 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 * 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_create(&test_loprio_thread, test_loprio_stack,
K_THREAD_STACK_SIZEOF(test_loprio_stack), K_THREAD_STACK_SIZEOF(test_loprio_stack),
multi_lowprio, 0, 0, 0, main_low_prio + 1, 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 */ /* Allow lower priority thread to add poll event in the list */
k_sleep(K_MSEC(250)); k_sleep(K_MSEC(250));
@ -596,7 +598,8 @@ void test_poll_threadstate(void)
k_thread_create(&test_thread, test_stack, k_thread_create(&test_thread, test_stack,
K_THREAD_STACK_SIZEOF(test_stack), threadstate, 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 */ /* wait for spawn thread to take action */
zassert_equal(k_poll(&event, 1, K_SECONDS(1)), 0, ""); zassert_equal(k_poll(&event, 1, K_SECONDS(1)), 0, "");

View file

@ -111,7 +111,7 @@ static void tqueue_thread_thread(struct k_queue *pqueue)
/**TESTPOINT: thread-thread data passing via queue*/ /**TESTPOINT: thread-thread data passing via queue*/
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_entry, pqueue, NULL, NULL, tThread_entry, pqueue, NULL, NULL,
K_PRIO_PREEMPT(0), 0, 0); K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
tqueue_append(pqueue); tqueue_append(pqueue);
k_sem_take(&end_sema, K_FOREVER); k_sem_take(&end_sema, K_FOREVER);
k_thread_abort(tid); 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_sem_init(&end_sema, 0, 1);
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_get, pqueue, NULL, NULL, 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, k_tid_t tid1 = k_thread_create(&tdata1, tstack1, STACK_SIZE,
tThread_get, pqueue, NULL, NULL, tThread_get, pqueue, NULL, NULL,
K_PRIO_PREEMPT(0), 0, 0); K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
/* Wait threads to initialize */ /* Wait threads to initialize */
k_sleep(K_MSEC(10)); k_sleep(K_MSEC(10));

View file

@ -94,7 +94,7 @@ static void tqueue_read_write(struct k_queue *pqueue)
/**TESTPOINT: thread-isr-thread data passing via queue*/ /**TESTPOINT: thread-isr-thread data passing via queue*/
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tThread_entry, pqueue, NULL, NULL, tThread_entry, pqueue, NULL, NULL,
K_PRIO_PREEMPT(0), 0, 0); K_PRIO_PREEMPT(0), 0, K_NO_WAIT);
TC_PRINT("main queue append ---> "); TC_PRINT("main queue append ---> ");
tqueue_append(pqueue); tqueue_append(pqueue);

View file

@ -100,7 +100,7 @@ void test_queue_supv_to_user(void)
k_thread_create(&child_thread, child_stack, STACK_SIZE, k_thread_create(&child_thread, child_stack, STACK_SIZE,
child_thread_get, q, sem, NULL, K_HIGHEST_THREAD_PRIO, 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(); k_yield();

View file

@ -56,7 +56,7 @@ void test_deadline(void)
worker_stacks[i], STACK_SIZE, worker_stacks[i], STACK_SIZE,
worker, INT_TO_POINTER(i), NULL, NULL, worker, INT_TO_POINTER(i), NULL, NULL,
K_LOWEST_APPLICATION_THREAD_PRIO, K_LOWEST_APPLICATION_THREAD_PRIO,
0, 0); 0, K_NO_WAIT);
/* Positive-definite number with the bottom 8 bits /* Positive-definite number with the bottom 8 bits
* masked off to prevent aliasing where "very close" * masked off to prevent aliasing where "very close"

View file

@ -330,12 +330,12 @@ void test_preempt(void)
k_thread_create(&worker_threads[i], k_thread_create(&worker_threads[i],
worker_stacks[i], STACK_SIZE, worker_stacks[i], STACK_SIZE,
worker, INT_TO_POINTER(i), NULL, NULL, worker, INT_TO_POINTER(i), NULL, NULL,
priority, 0, 0); priority, 0, K_NO_WAIT);
} }
k_thread_create(&manager_thread, manager_stack, STACK_SIZE, k_thread_create(&manager_thread, manager_stack, STACK_SIZE,
manager, NULL, NULL, NULL, 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 /* 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 * it part of the test. Just get out of the way until the

View file

@ -80,7 +80,8 @@ void test_priority_scheduling(void)
for (int i = 0; i < NUM_THREAD; i++) { for (int i = 0; i < NUM_THREAD; i++) {
tid[i] = k_thread_create(&t[i], tstacks[i], STACK_SIZE, tid[i] = k_thread_create(&t[i], tstacks[i], STACK_SIZE,
thread_tslice, INT_TO_POINTER(i), NULL, NULL, 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) { while (count < ITRERATION_COUNT) {

View file

@ -72,14 +72,14 @@ void test_sched_is_preempt_thread(void)
/*create preempt thread*/ /*create preempt thread*/
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tpreempt_ctx, NULL, NULL, NULL, 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_sem_take(&end_sema, K_FOREVER);
k_thread_abort(tid); k_thread_abort(tid);
/*create coop thread*/ /*create coop thread*/
tid = k_thread_create(&tdata, tstack, STACK_SIZE, tid = k_thread_create(&tdata, tstack, STACK_SIZE,
tcoop_ctx, NULL, NULL, NULL, 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_sem_take(&end_sema, K_FOREVER);
k_thread_abort(tid); k_thread_abort(tid);

View file

@ -41,7 +41,7 @@ void test_priority_cooperative(void)
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_entry, NULL, NULL, NULL, thread_entry, NULL, NULL, NULL,
spawn_prio, 0, 0); spawn_prio, 0, K_NO_WAIT);
/* checkpoint: current thread shouldn't preempted by higher thread */ /* checkpoint: current thread shouldn't preempted by higher thread */
zassert_true(last_prio == k_thread_priority_get(k_current_get()), NULL); zassert_true(last_prio == k_thread_priority_get(k_current_get()), NULL);
k_sleep(K_MSEC(100)); 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, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_entry, NULL, NULL, NULL, thread_entry, NULL, NULL, NULL,
spawn_prio, 0, 0); spawn_prio, 0, K_NO_WAIT);
/* checkpoint: thread is preempted by higher thread */ /* checkpoint: thread is preempted by higher thread */
zassert_true(last_prio == spawn_prio, NULL); zassert_true(last_prio == spawn_prio, NULL);
@ -86,7 +86,7 @@ void test_priority_preemptible(void)
spawn_prio = last_prio + 1; spawn_prio = last_prio + 1;
tid = k_thread_create(&tdata, tstack, STACK_SIZE, tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_entry, NULL, NULL, NULL, thread_entry, NULL, NULL, NULL,
spawn_prio, 0, 0); spawn_prio, 0, K_NO_WAIT);
/* checkpoint: thread is not preempted by lower thread */ /* checkpoint: thread is not preempted by lower thread */
zassert_false(last_prio == spawn_prio, NULL); zassert_false(last_prio == spawn_prio, NULL);
k_thread_abort(tid); k_thread_abort(tid);

View file

@ -59,7 +59,8 @@ static void spawn_threads(int sleep_sec)
STACK_SIZE, thread_entry, STACK_SIZE, thread_entry,
INT_TO_POINTER(i), INT_TO_POINTER(i),
INT_TO_POINTER(sleep_sec), 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_tid_t tid = k_thread_create(&t, tstack, STACK_SIZE,
(k_thread_entry_t)coop_thread, (k_thread_entry_t)coop_thread,
NULL, NULL, NULL, 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" zassert_false(executed == 1, "The thread didn't wait"
" for semaphore acquisition"); " 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, k_tid_t tid = k_thread_create(&tthread[0], tstack, STACK_SIZE,
thread_handler, NULL, NULL, NULL, 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); k_sem_take(&timer_sema, K_FOREVER);
/* wakeup a thread if the timer is expired */ /* wakeup a thread if the timer is expired */
k_wakeup(tid); k_wakeup(tid);

View file

@ -124,7 +124,8 @@ void test_slice_reset(void)
for (int i = 0; i < NUM_THREAD; i++) { for (int i = 0; i < NUM_THREAD; i++) {
tid[i] = k_thread_create(&t[i], tstacks[i], STACK_SIZE, tid[i] = k_thread_create(&t[i], tstacks[i], STACK_SIZE,
thread_time_slice, NULL, NULL, NULL, thread_time_slice, NULL, NULL, NULL,
K_PRIO_PREEMPT(j), 0, 0); K_PRIO_PREEMPT(j), 0,
K_NO_WAIT);
} }
/* enable time slice*/ /* enable time slice*/
k_sched_time_slice_set(SLICE_SIZE, K_PRIO_PREEMPT(0)); k_sched_time_slice_set(SLICE_SIZE, K_PRIO_PREEMPT(0));

View file

@ -101,7 +101,8 @@ void test_slice_scheduling(void)
tid[i] = k_thread_create(&t[i], tstacks[i], STACK_SIZE, tid[i] = k_thread_create(&t[i], tstacks[i], STACK_SIZE,
thread_tslice, thread_tslice,
INT_TO_POINTER(i), NULL, NULL, 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*/ /* enable time slice*/

View file

@ -28,7 +28,7 @@ void test_user_k_wakeup(void)
k_thread_create(&user_thread, ustack, STACK_SIZE, sleepy_thread, k_thread_create(&user_thread, ustack, STACK_SIZE, sleepy_thread,
NULL, NULL, NULL, NULL, NULL, NULL,
k_thread_priority_get(k_current_get()), 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_yield(); /* Let thread run and start sleeping forever */
k_wakeup(&user_thread); 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, k_thread_create(&user_thread, ustack, STACK_SIZE, preempt_test_thread,
NULL, NULL, NULL, NULL, NULL, NULL,
k_thread_priority_get(k_current_get()), 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); 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, k_thread_create(&user_thread, ustack, STACK_SIZE, preempt_test_thread,
NULL, NULL, NULL, NULL, NULL, NULL,
K_PRIO_PREEMPT(1), 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); k_sem_take(&user_sem, K_FOREVER);

View file

@ -34,7 +34,7 @@ static void tsema_thread_thread(struct k_sem *psem)
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_entry, psem, NULL, NULL, thread_entry, psem, NULL, NULL,
K_PRIO_PREEMPT(0), 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); zassert_false(k_sem_take(psem, K_FOREVER), NULL);
/*clean the spawn thread avoid side effect in next TC*/ /*clean the spawn thread avoid side effect in next TC*/

View file

@ -198,7 +198,7 @@ void test_sleep(void)
THREAD_STACK, THREAD_STACK,
(k_thread_entry_t) test_thread, (k_thread_entry_t) test_thread,
0, 0, NULL, TEST_THREAD_PRIORITY, 0, 0, NULL, TEST_THREAD_PRIORITY,
0, 0); 0, K_NO_WAIT);
TC_PRINT("Test thread started: id = %p\n", test_thread_id); TC_PRINT("Test thread started: id = %p\n", test_thread_id);
@ -206,7 +206,7 @@ void test_sleep(void)
helper_thread_stack, THREAD_STACK, helper_thread_stack, THREAD_STACK,
(k_thread_entry_t) helper_thread, (k_thread_entry_t) helper_thread,
0, 0, NULL, HELPER_THREAD_PRIORITY, 0, 0, NULL, HELPER_THREAD_PRIORITY,
0, 0); 0, K_NO_WAIT);
TC_PRINT("Helper thread started: id = %p\n", helper_thread_id); TC_PRINT("Helper thread started: id = %p\n", helper_thread_id);

View file

@ -118,7 +118,7 @@ void test_spinlock_bounce(void)
k_thread_create(&cpu1_thread, cpu1_stack, CPU1_STACK_SIZE, k_thread_create(&cpu1_thread, cpu1_stack, CPU1_STACK_SIZE,
cpu1_fn, NULL, NULL, NULL, cpu1_fn, NULL, NULL, NULL,
0, 0, 0); 0, 0, K_NO_WAIT);
k_busy_wait(10); k_busy_wait(10);

View file

@ -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, k_tid_t tid = k_thread_create(&thread_data, threadstack, STACK_SIZE,
tThread_entry, pstack, NULL, NULL, tThread_entry, pstack, NULL, NULL,
K_PRIO_PREEMPT(0), K_USER | K_PRIO_PREEMPT(0), K_USER |
K_INHERIT_PERMS, 0); K_INHERIT_PERMS, K_NO_WAIT);
tstack_push(pstack); tstack_push(pstack);
k_sem_take(&end_sema, K_FOREVER); k_sem_take(&end_sema, K_FOREVER);
@ -150,7 +150,8 @@ void test_stack_alloc_thread2thread(void)
/**TESTPOINT: thread-thread data passing via stack*/ /**TESTPOINT: thread-thread data passing via stack*/
k_tid_t tid = k_thread_create(&thread_data, threadstack, STACK_SIZE, k_tid_t tid = k_thread_create(&thread_data, threadstack, STACK_SIZE,
tThread_entry, &kstack_test_alloc, 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); tstack_push(&kstack_test_alloc);
k_sem_take(&end_sema, K_FOREVER); k_sem_take(&end_sema, K_FOREVER);

View file

@ -157,7 +157,7 @@ static void test_single_stack_play(void)
k_tid_t tid = k_thread_create(&thread_data, threadstack, TSTACK_SIZE, k_tid_t tid = k_thread_create(&thread_data, threadstack, TSTACK_SIZE,
thread_entry_fn_single, &stack1, NULL, thread_entry_fn_single, &stack1, NULL,
NULL, K_PRIO_PREEMPT(0), K_USER | NULL, K_PRIO_PREEMPT(0), K_USER |
K_INHERIT_PERMS, 0); K_INHERIT_PERMS, K_NO_WAIT);
/* Let the child thread run */ /* Let the child thread run */
k_sem_take(&end_sema, K_FOREVER); 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, k_tid_t tid = k_thread_create(&thread_data, threadstack, TSTACK_SIZE,
thread_entry_fn_dual, &stack1, &stack2, thread_entry_fn_dual, &stack1, &stack2,
NULL, K_PRIO_PREEMPT(0), K_USER | NULL, K_PRIO_PREEMPT(0), K_USER |
K_INHERIT_PERMS, 0); K_INHERIT_PERMS, K_NO_WAIT);
for (i = 0U; i < STACK_LEN; i++) { for (i = 0U; i < STACK_LEN; i++) {
/* Push items to stack2 */ /* 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, k_tid_t tid = k_thread_create(&thread_data, threadstack, TSTACK_SIZE,
thread_entry_fn_isr, &stack1, &stack2, thread_entry_fn_isr, &stack1, &stack2,
NULL, K_PRIO_PREEMPT(0), NULL, K_PRIO_PREEMPT(0),
K_INHERIT_PERMS, 0); K_INHERIT_PERMS, K_NO_WAIT);
/* Push items to stack2 */ /* Push items to stack2 */

View file

@ -50,7 +50,7 @@ static void create_dynamic_thread(void)
tid = k_thread_create(dyn_thread, dyn_thread_stack, STACKSIZE, tid = k_thread_create(dyn_thread, dyn_thread_stack, STACKSIZE,
dyn_thread_entry, NULL, NULL, NULL, 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(&start_sem, tid);
k_object_access_grant(&end_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, tid = k_thread_create(dyn_thread, dyn_thread_stack, STACKSIZE,
dyn_thread_entry, NULL, NULL, NULL, 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(&start_sem, tid);

View file

@ -95,7 +95,7 @@ void test_customdata_get_set_coop(void)
{ {
k_tid_t tid = k_thread_create(&tdata_custom, tstack_custom, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata_custom, tstack_custom, STACK_SIZE,
customdata_entry, NULL, NULL, NULL, customdata_entry, NULL, NULL, NULL,
K_PRIO_COOP(1), 0, 0); K_PRIO_COOP(1), 0, K_NO_WAIT);
k_sleep(K_MSEC(500)); k_sleep(K_MSEC(500));
@ -130,7 +130,7 @@ void test_thread_name_get_set(void)
/* Set and get child thread's name */ /* Set and get child thread's name */
k_tid_t tid = k_thread_create(&tdata_name, tstack_name, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata_name, tstack_name, STACK_SIZE,
thread_name_entry, NULL, NULL, NULL, 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"); ret = k_thread_name_set(tid, "customdata");
zassert_equal(ret, 0, "k_thread_name_set() failed"); 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 */ /* Set and get child thread's name */
k_tid_t tid = k_thread_create(&tdata_name, tstack_name, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata_name, tstack_name, STACK_SIZE,
thread_name_entry, NULL, NULL, NULL, 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"); ret = k_thread_name_set(tid, "customdata");
zassert_equal(ret, 0, "k_thread_name_set() failed"); zassert_equal(ret, 0, "k_thread_name_set() failed");
ret = k_thread_name_copy(tid, thread_name, sizeof(thread_name)); 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 */ /** TESTPOINT: custom data of preempt thread */
k_tid_t tid = k_thread_create(&tdata_custom, tstack_custom, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata_custom, tstack_custom, STACK_SIZE,
customdata_entry, NULL, NULL, NULL, 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)); k_sleep(K_MSEC(500));

View file

@ -41,7 +41,8 @@ void test_essential_thread_operation(void)
{ {
k_tid_t tid = k_thread_create(&kthread_thread, kthread_stack, k_tid_t tid = k_thread_create(&kthread_thread, kthread_stack,
STACKSIZE, (k_thread_entry_t)thread_entry, NULL, 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_sem_take(&sync_sem, K_FOREVER);
k_thread_abort(tid); k_thread_abort(tid);

View file

@ -62,7 +62,7 @@ void test_k_thread_foreach(void)
/* Create new thread which should add a new entry to the thread list */ /* Create new thread which should add a new entry to the thread list */
k_tid_t tid = k_thread_create(&tdata, tstack, k_tid_t tid = k_thread_create(&tdata, tstack,
STACK_SIZE, (k_thread_entry_t)thread_entry, NULL, 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)); k_sleep(K_MSEC(1));
/* Call k_thread_foreach() and check /* Call k_thread_foreach() and check

View file

@ -43,7 +43,7 @@ void test_threads_abort_self(void)
{ {
execute_flag = 0; execute_flag = 0;
k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_abort, 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)); k_sleep(K_MSEC(100));
/**TESTPOINT: spawned thread executed but abort itself*/ /**TESTPOINT: spawned thread executed but abort itself*/
zassert_true(execute_flag == 1, NULL); zassert_true(execute_flag == 1, NULL);
@ -64,7 +64,7 @@ void test_threads_abort_others(void)
execute_flag = 0; execute_flag = 0;
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_entry, NULL, NULL, NULL, thread_entry, NULL, NULL, NULL,
0, K_USER, 0); 0, K_USER, K_NO_WAIT);
k_thread_abort(tid); k_thread_abort(tid);
k_sleep(K_MSEC(100)); k_sleep(K_MSEC(100));
@ -73,7 +73,7 @@ void test_threads_abort_others(void)
tid = k_thread_create(&tdata, tstack, STACK_SIZE, tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_entry, NULL, NULL, NULL, thread_entry, NULL, NULL, NULL,
0, K_USER, 0); 0, K_USER, K_NO_WAIT);
k_sleep(K_MSEC(50)); k_sleep(K_MSEC(50));
k_thread_abort(tid); k_thread_abort(tid);
/**TESTPOINT: check running thread is aborted*/ /**TESTPOINT: check running thread is aborted*/
@ -93,7 +93,7 @@ void test_threads_abort_repeat(void)
execute_flag = 0; execute_flag = 0;
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_entry, NULL, NULL, NULL, thread_entry, NULL, NULL, NULL,
0, K_USER, 0); 0, K_USER, K_NO_WAIT);
k_thread_abort(tid); k_thread_abort(tid);
k_sleep(K_MSEC(100)); 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_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
(k_thread_entry_t)uthread_entry, NULL, NULL, NULL, (k_thread_entry_t)uthread_entry, NULL, NULL, NULL,
0, 0, 0); 0, 0, K_NO_WAIT);
tdata.fn_abort = &abort_function; 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_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
(k_thread_entry_t)delayed_thread_entry, NULL, NULL, NULL, (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 */ /* Give up CPU */
k_sleep(K_MSEC(50)); k_sleep(K_MSEC(50));

View file

@ -73,7 +73,8 @@ void test_threads_priority_set(void)
k_tid_t thread2_id = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t thread2_id = k_thread_create(&tdata, tstack, STACK_SIZE,
(k_thread_entry_t)thread2_set_prio_test, (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 */ /* Lower the priority of thread2 */
k_thread_priority_set(thread2_id, thread2_prio + 2); k_thread_priority_set(thread2_id, thread2_prio + 2);

View file

@ -49,7 +49,7 @@ void test_threads_spawn_params(void)
{ {
k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_params, k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_params,
tp1, INT_TO_POINTER(tp2), tp3, 0, tp1, INT_TO_POINTER(tp2), tp3, 0,
K_USER, 0); K_USER, K_NO_WAIT);
k_sleep(K_MSEC(100)); k_sleep(K_MSEC(100));
} }
@ -67,7 +67,7 @@ void test_threads_spawn_priority(void)
/* spawn thread with higher priority */ /* spawn thread with higher priority */
spawn_prio = k_thread_priority_get(k_current_get()) - 1; spawn_prio = k_thread_priority_get(k_current_get()) - 1;
k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_priority, 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)); k_sleep(K_MSEC(100));
} }
@ -85,7 +85,7 @@ void test_threads_spawn_delay(void)
/* spawn thread with higher priority */ /* spawn thread with higher priority */
tp2 = 10; tp2 = 10;
k_thread_create(&tdata, tstack, STACK_SIZE, thread_entry_delay, 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 */ /* 100 < 120 ensure spawn thread not start */
k_sleep(K_MSEC(100)); k_sleep(K_MSEC(100));
/* checkpoint: check spawn thread not execute */ /* checkpoint: check spawn thread not execute */

View file

@ -26,7 +26,7 @@ static void threads_suspend_resume(int prio)
k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE, k_tid_t tid = k_thread_create(&tdata, tstack, STACK_SIZE,
thread_entry, NULL, NULL, NULL, thread_entry, NULL, NULL, NULL,
create_prio, K_USER, 0); create_prio, K_USER, K_NO_WAIT);
/* checkpoint: suspend current thread */ /* checkpoint: suspend current thread */
k_thread_suspend(tid); k_thread_suspend(tid);
k_sleep(K_MSEC(100)); k_sleep(K_MSEC(100));

View file

@ -117,7 +117,7 @@ static void delayed_test_items_submit(void)
k_thread_create(&co_op_data, co_op_stack, STACK_SIZE, k_thread_create(&co_op_data, co_op_stack, STACK_SIZE,
(k_thread_entry_t)coop_work_main, (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) { for (i = 0; i < NUM_TEST_ITEMS; i += 2) {
TC_PRINT(" - Submitting work %d from preempt thread\n", i + 1); 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_create(&co_op_data, co_op_stack, STACK_SIZE,
(k_thread_entry_t)coop_delayed_work_main, (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) { for (i = 0; i < NUM_TEST_ITEMS; i += 2) {
TC_PRINT(" - Submitting delayed work %d from" 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_create(&co_op_data, co_op_stack, STACK_SIZE,
(k_thread_entry_t)coop_delayed_work_cancel_main, (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"); TC_PRINT(" - Waiting for work to finish\n");
k_sleep(WORK_ITEM_WAIT_ALIGNED); 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_create(&co_op_data, co_op_stack, STACK_SIZE,
(k_thread_entry_t)coop_delayed_work_resubmit, (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"); TC_PRINT(" - Waiting for work to finish\n");
k_sleep(WORK_ITEM_WAIT_ALIGNED); k_sleep(WORK_ITEM_WAIT_ALIGNED);

View file

@ -189,7 +189,7 @@ static void net_buf_test_3(void)
k_thread_create(&test_3_thread_data, test_3_thread_stack, k_thread_create(&test_3_thread_data, test_3_thread_stack,
K_THREAD_STACK_SIZEOF(test_3_thread_stack), K_THREAD_STACK_SIZEOF(test_3_thread_stack),
(k_thread_entry_t) test_3_thread, &fifo, &sema, NULL, (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, zassert_true(k_sem_take(&sema, TEST_TIMEOUT) == 0,
"Timeout while waiting for semaphore"); "Timeout while waiting for semaphore");

View file

@ -704,7 +704,7 @@ static k_tid_t start_timeout_v6_thread(s32_t timeout)
(k_thread_entry_t)timeout_thread, (k_thread_entry_t)timeout_thread,
udp_v6_ctx, INT_TO_POINTER(AF_INET6), udp_v6_ctx, INT_TO_POINTER(AF_INET6),
INT_TO_POINTER(timeout), 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) 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, (k_thread_entry_t)timeout_thread,
udp_v4_ctx, INT_TO_POINTER(AF_INET), udp_v4_ctx, INT_TO_POINTER(AF_INET),
INT_TO_POINTER(timeout), 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) static void net_ctx_recv_v6_timeout(void)

View file

@ -247,7 +247,7 @@ static void initialize_event_tests(void)
k_thread_create(&thrower_thread_data, thrower_stack, k_thread_create(&thrower_thread_data, thrower_stack,
K_THREAD_STACK_SIZEOF(thrower_stack), K_THREAD_STACK_SIZEOF(thrower_stack),
(k_thread_entry_t)thrower_thread, (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)) static int test_core_event(u32_t event, bool (*func)(void))