mirror of
https://gitee.com/openharmony/developtools_hdc
synced 2024-11-27 17:20:32 +00:00
!1488 feat:add thread yeild
Merge pull request !1488 from maliang/master
This commit is contained in:
commit
2579bf3ffd
@ -112,7 +112,7 @@ int HdcTCPBase::WriteUvTcpFd(uv_tcp_t *tcp, uint8_t *buf, int size)
|
||||
#else
|
||||
int fd = reinterpret_cast<int>(uvfd);
|
||||
#endif
|
||||
constexpr int intrmax = 1000;
|
||||
constexpr int intrmax = 60000;
|
||||
int intrcnt = 0;
|
||||
while (cnt > 0) {
|
||||
#ifdef HDC_EMULATOR
|
||||
@ -132,6 +132,7 @@ int HdcTCPBase::WriteUvTcpFd(uv_tcp_t *tcp, uint8_t *buf, int size)
|
||||
WRITE_LOG(LOG_WARN, "WriteUvTcpFd fd:%d send interrupt err:%d", fd, err);
|
||||
intrcnt = 0;
|
||||
}
|
||||
std::this_thread::yield();
|
||||
continue;
|
||||
} else {
|
||||
WRITE_LOG(LOG_FATAL, "WriteUvTcpFd fd:%d send rc:%d err:%d", fd, rc, err);
|
||||
|
Loading…
Reference in New Issue
Block a user