File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ static K_THREAD_STACK_DEFINE(stack, STACK_SIZE);
1717
1818pthread_mutex_t mutex1 ;
1919pthread_mutex_t mutex2 ;
20+ pthread_mutex_t mutex ;
2021
2122void * normal_mutex_entry (void * p1 )
2223{
@@ -213,20 +214,19 @@ static void timespec_add_ms(struct timespec *ts, uint32_t ms)
213214static void * test_mutex_timedlock_fn (void * arg )
214215{
215216 struct timespec time_point ;
216- pthread_mutex_t * mutex = (pthread_mutex_t * )arg ;
217+ pthread_mutex_t * mtx = (pthread_mutex_t * )arg ;
217218
218219 zassume_ok (clock_gettime (CLOCK_MONOTONIC , & time_point ));
219220 timespec_add_ms (& time_point , TIMEDLOCK_TIMEOUT_MS );
220221
221- return INT_TO_POINTER (pthread_mutex_timedlock (mutex , & time_point ));
222+ return INT_TO_POINTER (pthread_mutex_timedlock (mtx , & time_point ));
222223}
223224
224225/** @brief Test to verify @ref pthread_mutex_timedlock returns ETIMEDOUT */
225226ZTEST (posix_apis , test_mutex_timedlock )
226227{
227228 void * ret ;
228229 pthread_t th ;
229- pthread_t mutex ;
230230 pthread_attr_t attr ;
231231
232232 zassert_ok (pthread_attr_init (& attr ));
Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ static int barrier_failed;
5353static int barrier_done [N_THR_E ];
5454static int barrier_return [N_THR_E ];
5555
56+ static uint32_t param ;
57+
5658/* First phase bounces execution between two threads using a condition
5759 * variable, continuously testing that no other thread is mucking with
5860 * the protected state. This ends with all threads going back to
@@ -827,15 +829,14 @@ static void *fun(void *arg)
827829ZTEST (posix_apis , test_pthread_dynamic_stacks )
828830{
829831 pthread_t th ;
830- uint32_t x = 0 ;
831832
832833 if (!IS_ENABLED (CONFIG_DYNAMIC_THREAD )) {
833834 ztest_test_skip ();
834835 }
835836
836- zassert_ok (pthread_create (& th , NULL , fun , & x ));
837+ zassert_ok (pthread_create (& th , NULL , fun , & param ));
837838 zassert_ok (pthread_join (th , NULL ));
838- zassert_equal (BIOS_FOOD , x );
839+ zassert_equal (BIOS_FOOD , param );
839840}
840841
841842static void * non_null_retval (void * arg )
You can’t perform that action at this time.
0 commit comments