提交 d02d8dde 编写于 作者: S Stefan Hajnoczi

docs: mark nested AioContext locking as a legacy API

See the patch for why nested AioContext locking is no longer allowed.
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Message-id: 20171207201320.19284-3-stefanha@redhat.com
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 bd6458e4
Copyright (c) 2014 Red Hat Inc. Copyright (c) 2014-2017 Red Hat Inc.
This work is licensed under the terms of the GNU GPL, version 2 or later. See This work is licensed under the terms of the GNU GPL, version 2 or later. See
the COPYING file in the top-level directory. the COPYING file in the top-level directory.
...@@ -92,8 +92,9 @@ aio_context_acquire()/aio_context_release() for mutual exclusion. Once the ...@@ -92,8 +92,9 @@ aio_context_acquire()/aio_context_release() for mutual exclusion. Once the
context is acquired no other thread can access it or run event loop iterations context is acquired no other thread can access it or run event loop iterations
in this AioContext. in this AioContext.
aio_context_acquire()/aio_context_release() calls may be nested. This Legacy code sometimes nests aio_context_acquire()/aio_context_release() calls.
means you can call them if you're not sure whether #2 applies. Do not use nesting anymore, it is incompatible with the BDRV_POLL_WHILE() macro
used in the block layer and can lead to hangs.
There is currently no lock ordering rule if a thread needs to acquire multiple There is currently no lock ordering rule if a thread needs to acquire multiple
AioContexts simultaneously. Therefore, it is only safe for code holding the AioContexts simultaneously. Therefore, it is only safe for code holding the
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册