To make mosh multithreaded I had to transform all of the static variables into per thread ones. I used to routes to do this, using POSIX thread variables as much as I could as it is compatible with more iOS versions. Unfortunately some of them couldn't be done in this way and where triggered at the compiler level with __thread.
It would be great to remove this two implementations and either go with one for everything, or even better, fix mosh from the root.