Make sure EventPipe streaming thread won't write session->streaming_thread after...
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Wed, 8 Sep 2021 17:38:57 +0000 (10:38 -0700)
committerGitHub <noreply@github.com>
Wed, 8 Sep 2021 17:38:57 +0000 (10:38 -0700)
commit66c228e51827b91434fbb899fb413201d27cc1b6
tree5826abdc460359633e4b61cc9aead608162b62bf
parenta77b3910e11cd1000f9efb0e1f3e4ea5cca85266
Make sure EventPipe streaming thread won't write session->streaming_thread after session free. (#58710)

In case where ep_disable is called by a different thread (close IPC command)
there was a race between streaming threads setting
session->streaming_thread to NULL and IPC command triggering a call
to disable_holding_lock and freeing session.

Resetting the streaming_thread in streaming thread must happens before
it signals its shutdown event to prevent the race.

Co-authored-by: lateralusX <lateralusx.github@gmail.com>
src/native/eventpipe/ep-session.c