xiaoxiang781216 commented on code in PR #2076:
URL: https://github.com/apache/nuttx-apps/pull/2076#discussion_r1359891522


##########
testing/ostest/spinlock.c:
##########
@@ -61,16 +65,19 @@ static FAR void thread_spinlock(FAR void *parameter)
 void spinlock_test(void)
 {
   int status;
+  g_result = 0;
 
-  status = pthread_create(&g_thread1, NULL, (void *)thread_spinlock, NULL);
+  status = pthread_create(&g_thread1, NULL,
+                          (void *)thread_spinlock, &g_thread1);

Review Comment:
   remove the cast



##########
testing/ostest/spinlock.c:
##########
@@ -42,33 +42,38 @@ static spinlock_t lock = SP_UNLOCKED;
 static pthread_t g_thread1;
 static pthread_t g_thread2;
 
+#ifdef CONFIG_RW_SPINLOCK
+static pthread_t g_thread3;
+static rwlock_t rw_lock = RW_SP_UNLOCKED;
+#endif
+
 static int g_result = 0;
 
-static FAR void thread_spinlock(FAR void *parameter)
+static FAR void *thread_native_spinlock(FAR FAR void *parameter)

Review Comment:
   move spinlock change to the second patch



##########
testing/ostest/spinlock.c:
##########
@@ -61,16 +65,19 @@ static FAR void thread_spinlock(FAR void *parameter)
 void spinlock_test(void)
 {
   int status;
+  g_result = 0;
 
-  status = pthread_create(&g_thread1, NULL, (void *)thread_spinlock, NULL);
+  status = pthread_create(&g_thread1, NULL,
+                          (void *)thread_spinlock, &g_thread1);
   if (status != 0)
     {
       printf("spinlock_test: ERROR pthread_create failed, status=%d\n",
               status);
       ASSERT(false);
     }
 
-  status = pthread_create(&g_thread2, NULL, (void *)thread_spinlock, NULL);
+  status = pthread_create(&g_thread2, NULL,
+                          (void *)thread_spinlock, &g_thread2);

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to