<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/72527>72527</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Support] Signal handler register and unregister behavioral difference
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Dinistro
</td>
</tr>
</table>
<pre>
It seems that the signal handler registration and unregistration seem to behave differently. `RegisterHandler` can be called multiple times, while only the first run attaches the handlers, while `unregisterHandlers` removes the handlers on it's first execution, instead of the last one.
This makes it very cumbersome to safely register and deregister the handlers in a helper classes like `sys::fs::TempFile`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsUkFzozwM_TXmoiljnGCaA4d-Xyaze932DwisBG-NzVgiXf79DjRNtzt7QYPQ03t6PGT2l0jUqvo_VR8LnGVIuT366FlyKrrklva7ABONDDKggAwEKwgDDBhdoAyZLus4ik8RMDqY45fWigZJ0NGAVwLnz2fKFCUsJSirf2yzlL-9r1NWQ48ROoIeQyAH4xzET4FA_EiszP_wNvhAkGJYNj1nn1kgzxFQBPuBeGvf9P2BUFZ_aLvz8UqYaUzXv2CQInhRpuEbAf2ifl4vWhf6yELoIJ03UEAWSJFKpY9KP70_XwbPMOIrMXiBK-UF-nnsKHMaaXWE8UxhgQ9Fm3mO7q9f1PgICAOFiTL0AZmJIfjX7SheWO2e1O7pfKsvNE4nH0hZXRau3bnD7oAFtVWjdVVru7fF0JKrrXWHqkZboXWm0k2zc47wYE3XdU3hW6PNrqoqW1m913V5sPRoO23p0dnaVFrtNY3oQxnCdSxTvhSeeaa2MbVpioAdBd6yZUykN9g-KmPWqOV2xTx084XVXgfPwp9bxEvYQvk8T1PKouojPP8rdDfPPn_qe8h8yhjuQesJijmHdhCZNn_MSZnTxcswd2WfRmVOK_OtPEw5_aRelDltelmZ03bP7wAAAP__2AoVUg">