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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=285616
@ -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 New Issue
Block a user