Lines Matching +full:n +full:- +full:th

2  * Copyright (c) 2018-2023 Intel Corporation
4 * SPDX-License-Identifier: Apache-2.0
21 #define PTHREAD_CANCEL_INVALID -1
22 #define SCHED_INVALID -1
23 #define PRIO_INVALID -1
24 #define PTHREAD_INVALID -1
65 printk("Thread %d starting with scheduling policy %d & priority %d\n", in thread_top_exec()
67 /* Try a double-lock here to exercise the failing case of in thread_top_exec()
74 printk("pthread_mutex_trylock inexplicably succeeded\n"); in thread_top_exec()
103 printk("Racing bounce threads\n"); in thread_top_exec()
119 * which is non-standard but kosher per POSIX (and it works fine in thread_top_exec()
133 printk("Barrier exited early\n"); in thread_top_exec()
195 param.sched_priority = N_THR_T - id; in thread_top_term()
206 printk("Thread %d starting with a priority of %d\n", in thread_top_term()
217 zassert_equal(pthread_detach(self), EINVAL, "re-detached thread!"); in thread_top_term()
220 printk("Cancelling thread %d\n", id); in thread_top_term()
222 printk("Thread %d could not be cancelled\n", id); in thread_top_term()
234 * ZEPHYR [-CONFIG_NUM_COOP_PRIORITIES, -1] in ZTEST()
236 * POSIX(FIFO) [0, CONFIG_NUM_COOP_PRIORITIES - 1] in ZTEST()
238 for (int z_prio = -CONFIG_NUM_COOP_PRIORITIES, prio = CONFIG_NUM_COOP_PRIORITIES - 1, in ZTEST()
240 z_prio <= -1; z_prio++, prio--) { in ZTEST()
243 zassert_equal(p_prio, prio, "%d %d\n", p_prio, prio); in ZTEST()
248 * ZEPHYR [0, CONFIG_NUM_PREEMPT_PRIORITIES - 1] in ZTEST()
250 * POSIX(RR) [0, CONFIG_NUM_PREEMPT_PRIORITIES - 1] in ZTEST()
252 for (int z_prio = 0, prio = CONFIG_NUM_PREEMPT_PRIORITIES - 1, p_prio, policy; in ZTEST()
253 z_prio < CONFIG_NUM_PREEMPT_PRIORITIES; z_prio++, prio--) { in ZTEST()
256 zassert_equal(p_prio, prio, "%d %d\n", p_prio, prio); in ZTEST()
322 printk("Bounce test OK\n"); in ZTEST()
349 printk("Barrier test OK\n"); in ZTEST()
384 pthread_t th = {0}; in ZTEST() local
389 zassert_ok(pthread_create(&th, NULL, timedjoin_thread, INT_TO_POINTER(sleep_duration_ms))); in ZTEST()
393 zassert_equal(pthread_tryjoin_np(th, &retval), EBUSY); in ZTEST()
399 zassert_ok(pthread_tryjoin_np(th, &retval)); in ZTEST()
404 pthread_t th = {0}; in ZTEST() local
410 [0] = {.tv_sec = -1}, in ZTEST()
411 [1] = {.tv_nsec = -1}, in ZTEST()
422 not_done.tv_nsec -= NSEC_PER_SEC; in ZTEST()
426 done.tv_nsec -= NSEC_PER_SEC; in ZTEST()
430 zassert_ok(pthread_create(&th, NULL, timedjoin_thread, INT_TO_POINTER(sleep_duration_ms))); in ZTEST()
432 /* pthread_timedjoin-np must return -EINVAL for invalid struct timespecs */ in ZTEST()
433 zassert_equal(pthread_timedjoin_np(th, &ret, NULL), EINVAL); in ZTEST()
435 zassert_equal(pthread_timedjoin_np(th, &ret, &invalid[i]), EINVAL); in ZTEST()
439 zassert_equal(pthread_timedjoin_np(th, &ret, &not_done), ETIMEDOUT); in ZTEST()
442 zassert_ok(pthread_timedjoin_np(th, &ret, &done)); in ZTEST()
469 zassert_true((rc == -1 && err == ENOSYS)); in ZTEST()
477 zassert_true((rc == -1 && err == ENOSYS)); in ZTEST()
487 zassert_true((rc == -1 && err == ENOSYS)); in ZTEST()
499 zassert_true((rc == -1 && err == ENOSYS)); in ZTEST()
511 zassert_true((rc == -1 && err == ENOSYS)); in ZTEST()
544 pthread_t th; in ZTEST() local
546 zassert_ok(pthread_create(&th, NULL, test_pthread_cleanup_entry, NULL)); in ZTEST()
547 zassert_ok(pthread_join(th, NULL)); in ZTEST()
582 pthread_t th; in ZTEST() local
584 zassert_ok(pthread_create(&th, NULL, test_pthread_cancel_fn, NULL)); in ZTEST()
585 zassert_ok(pthread_join(th, NULL)); in ZTEST()
610 pthread_t th; in ZTEST() local
612 zassert_ok(pthread_create(&th, NULL, test_pthread_setschedprio_fn, NULL)); in ZTEST()
613 zassert_ok(pthread_join(th, NULL)); in ZTEST()