!756 fix: 修复重复执行内存用例导致系统卡死问题

Merge pull request !756 from Harylee/print
This commit is contained in:
openharmony_ci 2021-12-30 08:23:14 +00:00 committed by Gitee
commit 997e61ed53
1 changed files with 2 additions and 1 deletions

View File

@ -47,6 +47,7 @@
#include "los_excinfo_pri.h"
#endif
#include "los_exc_pri.h"
#include "los_sched_pri.h"
#define SIZEBUF 256
@ -94,7 +95,7 @@ STATIC VOID ConsoleOutput(const CHAR *str, UINT32 len)
for (;;) {
cnt = write(STDOUT_FILENO, str + written, (size_t)toWrite);
if ((cnt < 0) || ((cnt == 0) && (OS_INT_ACTIVE)) || (toWrite == cnt)) {
if ((cnt < 0) || ((cnt == 0) && ((!OsPreemptable()) || (OS_INT_ACTIVE))) || (toWrite == cnt)) {
break;
}
written += cnt;