This is a bit of a follow-up to this question.
Suppose I use sigaction to set up a signal handler of my own design. In this signal handler, I access information about the CPU state (the thread's stack pointer, for example) and copy it to a predetermined location in memory. I now want to examine a value on this thread's stack from another thread.
Is there a way to suspend execution of the thread in the signal handler from within the same signal handler, so that I can safely examine this thread's stack from another thread? (Note: I define "safely" here to mean "without worrying about the thread completing or returning from a function.)
If I was outside of the signal handler, I could use sigsupend; however, it's not safe to use within the signal handler according to the GNU documentation. I could also try extending a signal using the method described in this question, but I don't think any of the standard *nix signals will help me here.