Page MenuHomeFreeBSD

emulated atomic64: disable interrupts as the lock mechanism on !SMP
ClosedPublic

Authored by kevans on Jan 3 2020, 1:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 23 2024, 4:35 AM
Unknown Object (File)
Mar 12 2024, 12:45 PM
Unknown Object (File)
Jan 12 2024, 2:40 PM
Unknown Object (File)
Dec 22 2023, 10:18 PM
Unknown Object (File)
Nov 8 2023, 2:51 PM
Unknown Object (File)
Nov 7 2023, 9:43 AM
Unknown Object (File)
Nov 6 2023, 3:41 PM
Unknown Object (File)
Nov 6 2023, 3:34 AM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/kern/subr_atomic64.c
78 ↗(On Diff #66285)

Why not make LOCK_A64() be more like:

{ register s; s = intr_disable();

and UNLOCK_A64() be:

intr_restore(s); }

Then you don't need the added LOCK_DECL.

I think pthread_cleanup_push() and pthread_cleanup_pop() do something like this.

kevans marked an inline comment as done.

Use better construct to eliminate separate LOCK_DECL that's only used for !SMP

This revision is now accepted and ready to land.Jan 3 2020, 3:26 PM

The changes look good to me as well.