Macro: SB-THREAD:BARRIER

package type

Insert a barrier in the code stream, preventing some sort of reordering.

KIND should be one of:

:COMPILER Prevent the compiler from reordering memory access across the barrier. :MEMORY Prevent the cpu from reordering any memory access across the barrier. :READ Prevent the cpu from reordering any read access across the barrier. :WRITE Prevent the cpu from reordering any write access across the barrier. :DATA-DEPENDENCY Prevent the cpu from reordering dependent memory reads across the barrier (requiring reads before the barrier to complete before any reads after the barrier that depend on them). This is a weaker form of the :READ barrier.

FORMS is an implicit PROGN, evaluated before the barrier. BARRIER returns the values of the last form in FORMS.

The file “memory-barriers.txt” in the Linux kernel documentation is highly recommended reading for anyone programming at this level.

Lambda list

((sb-thread::kind) &body sb-thread::forms)