1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

use PTHREAD_PROCESS_SHARED instead of magic 1

This commit is contained in:
Desour 2023-06-08 23:07:46 +02:00
parent 1c76f32d19
commit 2638dc41d1
2 changed files with 3 additions and 3 deletions

View file

@ -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;

View file

@ -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