Fix-Point commented on code in PR #3936:
URL: https://github.com/apache/nuttx-apps/pull/3936#discussion_r4438487865
##########
testing/ostest/spinlock.c:
##########
@@ -236,37 +334,118 @@ void run_test_thread(void *lock, FAR void
*(*thread_func)(FAR void *arg),
****************************************************************************/
/****************************************************************************
- * Name: spinlock_test
+ * Name: spinlock_test_thread_num
+ *
+ * Description:
+ * Run lock performance tests for a specific number of threads.
+ * This function tests three different lock types:
+ * - spinlock_t: Basic spinlock
+ * - rspinlock_t: Recursive spinlock
+ * - seqcount_t: Sequence counter lock
+ *
+ * Input Parameters:
+ * thread_num - Number of threads to use in the test
+ *
+ * Returned Value:
+ * None
+ *
****************************************************************************/
static void spinlock_test_thread_num(unsigned thread_num)
{
- aligned_data(64) union
+ union
{
spinlock_t spinlock;
rspinlock_t rspinlock;
seqcount_t seqcount;
} lock;
- printf("Start Lock test:\n");
printf("Thread num: %u, Loop times: %d\n\n", thread_num, LOOP_TIMES);
+ /* Test basic spinlock */
+
spin_lock_init(&lock.spinlock);
run_test_thread(&lock, spinlock_t_test_thread, thread_num, "spinlock");
+ /* Test read-write spinlock */
Review Comment:
Done.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]