Class UnixFSMemoryUtils
java.lang.Object
dev.getelements.elements.rt.transact.unix.UnixFSMemoryUtils
Some dirty hacks to support atomic memory access.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAtomicLong
(ByteBuffer byteBuffer) Makes an instance ofUnixFSAtomicLong
from for details.abstract UnixFSAtomicLong
getAtomicLong
(ByteBuffer byteBuffer, int position) Gets aUnixFSAtomicLong
with the suppliedByteBuffer
.static UnixFSMemoryUtils
Gets the instance of theUnixFSMemoryUtils
based on the system configuration.
-
Constructor Details
-
UnixFSMemoryUtils
public UnixFSMemoryUtils()
-
-
Method Details
-
getInstance
Gets the instance of theUnixFSMemoryUtils
based on the system configuration.- Returns:
- the instance of
UnixFSMemoryUtils
-
getAtomicLong
Makes an instance ofUnixFSAtomicLong
from for details. -
getAtomicLong
Gets aUnixFSAtomicLong
with the suppliedByteBuffer
. The 64-bit counter object will be placed at theByteBuffer
'sBuffer.position()
. TheByteBuffer
's position is unchanged. This presumes that theBuffer.position()
is properly aligned for this type of atomic operation and if it is not, then undefined behavior may result.- Parameters:
byteBuffer
- theByteBuffer
position
- the positing within theByteBuffer
- Returns:
- the
UnixFSAtomicLong
- Throws:
IllegalArgumentException
- if this method can detect misalignment, or otherwise improper use
-