From 2638dc41d1dfa0bc1e55281b8fcdf5c3d52f2cb0 Mon Sep 17 00:00:00 2001 From: Desour Date: Thu, 8 Jun 2023 23:07:46 +0200 Subject: [PATCH] use PTHREAD_PROCESS_SHARED instead of magic 1 --- src/threading/ipc_channel.cpp | 4 ++-- src/threading/ipc_channel.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/threading/ipc_channel.cpp b/src/threading/ipc_channel.cpp index 982e3831e..dce4ed602 100644 --- a/src/threading/ipc_channel.cpp +++ b/src/threading/ipc_channel.cpp @@ -44,9 +44,9 @@ IPCChannelBuffer::IPCChannelBuffer() goto error_condattr_init; if (pthread_mutexattr_init(&mutexattr) != 0) goto error_mutexattr_init; - if (pthread_condattr_setpshared(&condattr, 1) != 0) + if (pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) != 0) goto error_condattr_setpshared; - if (pthread_mutexattr_setpshared(&mutexattr, 1) != 0) + if (pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) != 0) goto error_mutexattr_setpshared; if (pthread_cond_init(&cond, &condattr) != 0) goto error_cond_init; diff --git a/src/threading/ipc_channel.h b/src/threading/ipc_channel.h index a6ea47303..5c68173ea 100644 --- a/src/threading/ipc_channel.h +++ b/src/threading/ipc_channel.h @@ -82,7 +82,7 @@ struct IPCChannelBuffer u8 data[IPC_CHANNEL_MSG_SIZE] = {}; IPCChannelBuffer(); - ~IPCChannelBuffer(); + ~IPCChannelBuffer(); // Note: only destruct once, i.e. in one process }; struct IPCChannelShared