File: truffle_object.rb

package info (click to toggle)
ruby-concurrent 1.0.5-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,200 kB
  • sloc: ruby: 27,502; java: 6,085; ansic: 282; sh: 82; makefile: 4
file content (31 lines) | stat: -rw-r--r-- 620 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module Concurrent
  module Synchronization

    module TruffleAttrVolatile
      def self.included(base)
        base.extend(ClassMethods)
      end

      module ClassMethods
        def attr_volatile(*names)
          # TODO may not always be available
          attr_atomic(*names)
        end
      end

      def full_memory_barrier
        Truffle::System.full_memory_barrier
      end
    end

    # @!visibility private
    # @!macro internal_implementation_note
    class TruffleObject < AbstractObject
      include TruffleAttrVolatile

      def initialize
        # nothing to do
      end
    end
  end
end