I do not have experience using threads. However, I have checked out some documents, on this forum, you might find useful to solve the issues you are encountering. I will list them below.
System resources are not thread-safe. The USB serial debug port (Serial) can only be called safely from multiple threads if you surround all accesses with WITH_LOCK(). An example would be changing the following line
Serial.printlnf("-- Current state: %s", g_State->getName());
to
WITH_LOCK(Serial) {
Serial.printlnf("-- Current state: %s", g_State->getName());
}
You might find these helpful:
https://community.particle.io/t/particle-threads-tutorial/41362
https://community.particle.io/t/delays-in-multithreading/50338