mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
Do not use atomic_swap_int(9), it is not available on all
architectures. Atomic_cmpset_int(9) is a direct replacement, due to loop. The change fixes arm, arm64, mips an sparc64, which lack atomic_swap(). Suggested and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
This commit is contained in:
parent
57198f08d3
commit
70a3efc14f
1 changed files with 2 additions and 2 deletions
|
|
@ -1327,7 +1327,7 @@ ithread_loop(void *arg)
|
|||
* we are running, it will set it_need to note that we
|
||||
* should make another pass.
|
||||
*/
|
||||
while (atomic_swap_int(&ithd->it_need, 0) != 0) {
|
||||
while (atomic_cmpset_int(&ithd->it_need, 1, 0) != 0) {
|
||||
/*
|
||||
* This needs a release barrier to make sure
|
||||
* that this write posts before any of the
|
||||
|
|
@ -1506,7 +1506,7 @@ ithread_loop(void *arg)
|
|||
* we are running, it will set it_need to note that we
|
||||
* should make another pass.
|
||||
*/
|
||||
while (atomic_swap_int(&ithd->it_need, 0) != 0) {
|
||||
while (atomic_cmpset_int(&ithd->it_need, 1, 0) != 0) {
|
||||
/*
|
||||
* This needs a release barrier to make sure
|
||||
* that this write posts before any of the
|
||||
|
|
|
|||
Loading…
Reference in a new issue