I know this is a bad idea! Certainly for safe programming the stack for a given thread should be considered private to that thread. But POSIX at least guarantees that all of a thread's memory is shared and writeable by other threads, which means the stack of one thread can (in theory) be written to by another thread. So I'm curious how one could do that.
The only way I can think of would be to pass the address of a local variable in thread B to thread A and have A start writing to that general area. But this doesn't fully emulate function calls in C. In particular I'm curious if it's possible to say, have thread A sleep while its program counter is set to the first line of some function that takes parameters, and then on thread B actually push those parameters onto the stack, then resume thread A and have it execute as if the function were originally called in thread A with those parameters. I think this requires thread B to be able to access thread A's registers under at least x86 calling conventions, and I'm not sure that's possible.