| 1012 | extern "C" __attribute__((noreturn)) |
| 1013 | void _photon_thread_die(thread* th) asm("_photon_thread_die"); |
| 1014 | void _photon_thread_die(thread* th) { |
| 1015 | assert(th == CURRENT); |
| 1016 | th->die(); |
| 1017 | __builtin_unreachable(); |
| 1018 | } |
| 1019 | |
| 1020 | // the function is written in assembly to make use of the fact |
| 1021 | // that CURRENT is passed in via rbp/x29 as the first argument, |