Open Brhett opened 8 years ago
Repeats still on Macbook Pro.
The root cause should be the port implementation of libjSSC-2.8_[x86].so that the select()
is blocked even if the handle was closed.
A possible trick to fix this issue is adding a timeout to select()
and check the return value of it. See pseudo-code below.
int ret = select(portHandle +1, &read_fd_set, NULL, NULL, &internal_timeout);
if (ret == -1)
{
throwSerialPortException(...);
return NULL;
}
else if (!FD_ISSET(portHandle, &read_fd_set))
{
continue;
}
The "read" method is blocking in the thread "ZToolPacketParser". Thus, "parserThread.join()" might be blocked during closing of "ZToolPacketParser".
Tested on the current head version eaf7129.