请问在修改 proxy->enabled 时候使用 __ATOMIC_SEQ_CST,为什么在 bh_hub_push_stack 和 bh_hub_get_prev_func 是普通读呢? #116
birdmanwings
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
在看 bhook 的源码的时候,看到在 bh_hub_add_proxy 和 bh_hub_del_proxy 修改 proxy->enabled 都是 __ATOMIC_SEQ_CST 的。但是为什么无锁的 bh_hub_push_stack / bh_hub_get_prev_func 中判断 if (proxy->enabled) 是直接读的呢?
这里不需要 __atomic_load_n 原子读么,不会读到旧值么?向大佬请教下
Beta Was this translation helpful? Give feedback.
All reactions