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)
Sat, Jul 4, 4:48 AM
Unknown Object (File)
Fri, Jul 3, 9:39 PM
Unknown Object (File)
Thu, Jul 2, 9:10 PM
Unknown Object (File)
Thu, Jul 2, 7:47 PM
Unknown Object (File)
Wed, Jul 1, 6:30 AM
Unknown Object (File)
May 11 2026, 3:17 AM
Unknown Object (File)
May 11 2026, 3:15 AM
Unknown Object (File)
May 11 2026, 3:14 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.