Fix pthread to number converstion ^KT-52429

Merge-request: KT-MR-6918
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
This commit is contained in:
Alexander Shabalin
2022-08-23 16:36:24 +00:00
committed by Space
parent 45fc5fb76b
commit 58569f2eee
2 changed files with 12 additions and 4 deletions
@@ -1,6 +1,7 @@
#include "workerSignals.h"
#include <cassert>
#include <cstring>
#include <pthread.h>
#include <signal.h>
@@ -21,7 +22,8 @@ extern "C" void setupSignalHandler(void) {
extern "C" void signalThread(uint64_t thread, int value) {
pendingValue = value;
auto t = reinterpret_cast<pthread_t>(thread);
pthread_t t = {};
memcpy(&t, &thread, sizeof(pthread_t));
auto result = pthread_kill(t, SIGUSR1);
assert(result == 0);
}