From 787a6034170b59d55afe8d0a12cb0904f20cb74d Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sun, 16 Aug 2015 02:18:47 +0200 Subject: codify locking contracts Conflicts: vm/vm_page.h --- ipc/ipc_mqueue.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ipc/ipc_mqueue.c') diff --git a/ipc/ipc_mqueue.c b/ipc/ipc_mqueue.c index 9138aec..22d8f43 100644 --- a/ipc/ipc_mqueue.c +++ b/ipc/ipc_mqueue.c @@ -88,6 +88,9 @@ ipc_mqueue_move( ipc_kmsg_t kmsg, next; ipc_thread_t th; + assert(have_imq_lock(dest)); + assert(have_imq_lock(source)); + oldq = &source->imq_messages; newq = &dest->imq_messages; blockedq = &dest->imq_threads; @@ -146,6 +149,8 @@ ipc_mqueue_changed( { ipc_thread_t th; + assert(have_imq_lock(mqueue)); + while ((th = ipc_thread_dequeue(&mqueue->imq_threads)) != ITH_NULL) { th->ith_state = mr; thread_go(th); @@ -535,6 +540,8 @@ ipc_mqueue_receive( if (resume) goto after_thread_block; + assert(have_imq_lock(mqueue)); + for (;;) { kmsg = ipc_kmsg_queue_first(kmsgs); if (kmsg != IKM_NULL) { -- cgit v1.2.3