I've got a Port object which seems to be freezing after random periods of time working. When I debug the freeze it's sitting on the .Write() function, and in the call stack, it's called System.Threading.EventWaitHandle.WaitOne(), which has called PInvoke.PAL.Threading_Event_Wait() and there it waits.
On two other threads, have similar SerialNet.Port related activity. On one I have it waiting on Port.m_dispatch_func(), then EvenWaitHandle.WaitOne(), and PAL.Threading_Event_Wait(). On the other I have it waiting on m_write_func(), then SerialNET.Win32.WriteFile(), and SerialNET.Win32.WriteFileCE().
I assume that there's a deadlock which has occurred, but given that the two threads which are waiting aren't linked to my code, I can't see how I can get them to stop blocking (I assume it's obviously related to something my code has done, even if it's now no longer connected in the call stack as such).
My comms code seems to work fine for random periods of time, then suddenly just freezes.