diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-08-16 02:18:47 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-08-28 15:47:56 +0200 |
commit | 787a6034170b59d55afe8d0a12cb0904f20cb74d (patch) | |
tree | d20fcc9b98882c7bb62500185cbfb08006fec26a /ipc/ipc_mqueue.c | |
parent | 069a8a3decf5981cd420014384ead470eac8561c (diff) |
codify locking contracts
Conflicts:
vm/vm_page.h
Diffstat (limited to 'ipc/ipc_mqueue.c')
-rw-r--r-- | ipc/ipc_mqueue.c | 7 |
1 files changed, 7 insertions, 0 deletions
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) { |