mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
rcu: use coroutine TLS macros
RCU may be used from coroutines. Standard __thread variables cannot be used by coroutines. Use the coroutine TLS macros instead. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20220222140150.27240-4-stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
47b7446456
commit
17c78154b0
4 changed files with 16 additions and 15 deletions
|
@ -171,7 +171,7 @@ static void *rcu_q_reader(void *arg)
|
|||
|
||||
rcu_register_thread();
|
||||
|
||||
*(struct rcu_reader_data **)arg = &rcu_reader;
|
||||
*(struct rcu_reader_data **)arg = get_ptr_rcu_reader();
|
||||
qatomic_inc(&nthreadsrunning);
|
||||
while (qatomic_read(&goflag) == GOFLAG_INIT) {
|
||||
g_usleep(1000);
|
||||
|
@ -206,7 +206,7 @@ static void *rcu_q_updater(void *arg)
|
|||
long long n_removed_local = 0;
|
||||
struct list_element *el, *prev_el;
|
||||
|
||||
*(struct rcu_reader_data **)arg = &rcu_reader;
|
||||
*(struct rcu_reader_data **)arg = get_ptr_rcu_reader();
|
||||
qatomic_inc(&nthreadsrunning);
|
||||
while (qatomic_read(&goflag) == GOFLAG_INIT) {
|
||||
g_usleep(1000);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue