| 22 | } |
| 23 | |
| 24 | static void cleanup_handler2(void *arg) { |
| 25 | cleanup_state <<= 3; |
| 26 | // Perform non-commutative arithmetic to a global var that encodes the cleanup stack order ops. |
| 27 | cleanup_state *= (intptr_t)arg; |
| 28 | printf("Called clean-up handler 2 with arg %p (state=%d)\n", arg, cleanup_state); |
| 29 | } |
| 30 | |
| 31 | static void *thread_start1(void *arg) { |
| 32 | printf("thread_start1\n"); |