MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / group2_entry

Function group2_entry

examples/utest/testcases/mm/test_synchronization.h:82–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82static void group2_entry(void *param)
83{
84 const size_t id = (size_t)param;
85 size_t test_times = TEST_TIMES;
86 size_t alive = test_times / 10;
87 void *buf;
88
89 while (test_times--)
90 {
91 if (test_times % alive == 0)
92 uassert_true(1);
93
94 semaphore_signal(&sem2[id]);
95 semaphore_wait(&sem1[id]);
96 buf = map();
97
98 memset(buf, 'a' + id, BUF_SIZE);
99 /* if other core write to our cache, force the changes to be visible to us */
100 rt_hw_dmb();
101
102 if (memtest(buf, 'a' + id, BUF_SIZE))
103 uassert_true(0);
104
105 unmap(buf);
106 }
107
108 rt_sem_release(&done);
109 return;
110}
111
112/**
113 * @brief On a smp system, we create at least 4 threads

Callers

nothing calls this directly

Calls 7

semaphore_signalFunction · 0.85
semaphore_waitFunction · 0.85
mapFunction · 0.85
memtestFunction · 0.85
unmapFunction · 0.85
rt_sem_releaseFunction · 0.85
rt_hw_dmbFunction · 0.50

Tested by

no test coverage detected