diff options
author | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2022-05-26 09:28:42 +0200 |
---|---|---|
committer | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2022-05-26 12:02:44 +0200 |
commit | f6bd4ad198cb5bb86c508e4d18f9eb4bc0c4f77b (patch) | |
tree | 96fbb5a4d0d80156397af9a9cf153f2a1287b422 /lib/intel_allocator_msgchannel.c | |
parent | fbf50cdeb06c4bb32faa2fbed66a6910ed248060 (diff) |
lib/intel_allocator: Add flag signalling multiprocess readyness
Currently when children processes try to communicate to not existing
allocator thread they got crash with vague SIGSEGV.
Adding readyness flag and detailed explanation in assert should hint
the developer to add missing intel_allocator_multiprocess_start|stop)
functions.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'lib/intel_allocator_msgchannel.c')
-rw-r--r-- | lib/intel_allocator_msgchannel.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/intel_allocator_msgchannel.c b/lib/intel_allocator_msgchannel.c index 172858d3..cd0f0a5d 100644 --- a/lib/intel_allocator_msgchannel.c +++ b/lib/intel_allocator_msgchannel.c @@ -75,6 +75,7 @@ static void msgqueue_init(struct msg_channel *channel) msgdata->key = key; msgdata->queue = queue; channel->priv = msgdata; + channel->ready = true; } static void msgqueue_deinit(struct msg_channel *channel) @@ -84,6 +85,7 @@ static void msgqueue_deinit(struct msg_channel *channel) igt_debug("Deinit msgqueue\n"); msgctl(msgdata->queue, IPC_RMID, NULL); free(channel->priv); + channel->ready = false; } static int msgqueue_send_req(struct msg_channel *channel, |