That's obviously based on the standard serial.pp, which hasn't had any attention for many years /but/ was tested on Linux, Windows (2Kish?) and SunOS/Solaris (which should be fairly similar to MacOS or whatever it's called).
It extended work that somebody else had done, but I was specifically focusing on low-level access and the calls will typically be in their own thread. At the time I was working on a serial comms analyzer (to capture the protocol between two commercial comms analyzers) and I very much wanted each captured byte to have a timestamp and a snapshot of the control line states.
On Windows it gets sole-access to the port, on unix it doesn't (which is something I'd be inclined to change). Also it doesn't have a SerAvailable(), but in Linux that has a gotcha: the result is truncated at 4K. More details in that repo, which also has stuff to detect various USB devices (which in practice are often built into e.g. a multimeter, Arduino etc.).
MarkMLl