Skip to content

Commit a95e169

Browse files
crafcat7xiaoxiang781216
authored andcommitted
ostest:Fix the issue that nxevent pthread was not executed, causing case failed
Summary: In the case of complex business and 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 25fa919 commit a95e169

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

testing/ostest/nxevent.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ void nxevent_test(void)
278278

279279
/* Lower priority */
280280

281-
sparam.sched_priority = PTHREAD_DEFAULT_PRIORITY - 1;
281+
sparam.sched_priority = PTHREAD_DEFAULT_PRIORITY;
282282
pthread_attr_setschedparam(&attr, &sparam);
283283

284284
/* Create thread */
@@ -301,7 +301,7 @@ void nxevent_test(void)
301301

302302
/* Lower priority */
303303

304-
sparam.sched_priority = PTHREAD_DEFAULT_PRIORITY - 1;
304+
sparam.sched_priority = PTHREAD_DEFAULT_PRIORITY;
305305
pthread_attr_setschedparam(&attr, &sparam);
306306

307307
/* Create thread */

0 commit comments

Comments
 (0)