Skip to content

Commit a0f05d0

Browse files
crafcat7jerpelea
authored andcommitted
ostest:Fix the issue that nxevent pthread was not executed, causing case failed
Summary: In the case of slow overall system response (such as when MM_KASAN is turned on), the nxevent case work thread will not be executed and will be switched back to the main thread, so that the event does not get the expected result and the case fails. By adjusting the thread priority, the work thread can be scheduled to avoid the expected result failure Signed-off-by: chenrun1 <[email protected]>
1 parent 2e61c6b commit a0f05d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

testing/ostest/nxevent.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ void nxevent_test(void)
281281

282282
/* Lower priority */
283283

284-
sparam.sched_priority = PTHREAD_DEFAULT_PRIORITY - 1;
284+
sparam.sched_priority = PTHREAD_DEFAULT_PRIORITY;
285285
pthread_attr_setschedparam(&attr, &sparam);
286286

287287
/* Create thread */
@@ -304,7 +304,7 @@ void nxevent_test(void)
304304

305305
/* Lower priority */
306306

307-
sparam.sched_priority = PTHREAD_DEFAULT_PRIORITY - 1;
307+
sparam.sched_priority = PTHREAD_DEFAULT_PRIORITY;
308308
pthread_attr_setschedparam(&attr, &sparam);
309309

310310
/* Create thread */

0 commit comments

Comments
 (0)