< prev index next >

src/share/vm/runtime/atomic.hpp

Print this page
rev 12906 : [mq]: gc_interface


  54   // provided on SPARC/X86. We assume that strength is necessary unless
  55   // we can prove that a weaker form is sufficiently safe.
  56 
  57   // Atomically store to a location
  58   inline static void store    (jbyte    store_value, jbyte*    dest);
  59   inline static void store    (jshort   store_value, jshort*   dest);
  60   inline static void store    (jint     store_value, jint*     dest);
  61   // See comment above about using jlong atomics on 32-bit platforms
  62   inline static void store    (jlong    store_value, jlong*    dest);
  63   inline static void store_ptr(intptr_t store_value, intptr_t* dest);
  64   inline static void store_ptr(void*    store_value, void*     dest);
  65 
  66   inline static void store    (jbyte    store_value, volatile jbyte*    dest);
  67   inline static void store    (jshort   store_value, volatile jshort*   dest);
  68   inline static void store    (jint     store_value, volatile jint*     dest);
  69   // See comment above about using jlong atomics on 32-bit platforms
  70   inline static void store    (jlong    store_value, volatile jlong*    dest);
  71   inline static void store_ptr(intptr_t store_value, volatile intptr_t* dest);
  72   inline static void store_ptr(void*    store_value, volatile void*     dest);
  73 




  74   // See comment above about using jlong atomics on 32-bit platforms
  75   inline static jlong load(volatile jlong* src);


  76 
  77   // Atomically add to a location. Returns updated value. add*() provide:
  78   // <fence> add-value-to-dest <membar StoreLoad|StoreStore>
  79   inline static jshort   add    (jshort   add_value, volatile jshort*   dest);
  80   inline static jint     add    (jint     add_value, volatile jint*     dest);
  81   inline static size_t   add    (size_t   add_value, volatile size_t*   dest);
  82   inline static intptr_t add_ptr(intptr_t add_value, volatile intptr_t* dest);
  83   inline static void*    add_ptr(intptr_t add_value, volatile void*     dest);
  84 
  85   // Atomically increment location. inc*() provide:
  86   // <fence> increment-dest <membar StoreLoad|StoreStore>
  87   inline static void inc    (volatile jint*     dest);
  88   inline static void inc    (volatile jshort*   dest);
  89   inline static void inc    (volatile size_t*   dest);
  90   inline static void inc_ptr(volatile intptr_t* dest);
  91   inline static void inc_ptr(volatile void*     dest);
  92 
  93   // Atomically decrement a location. dec*() provide:
  94   // <fence> decrement-dest <membar StoreLoad|StoreStore>
  95   inline static void dec    (volatile jint*     dest);




  54   // provided on SPARC/X86. We assume that strength is necessary unless
  55   // we can prove that a weaker form is sufficiently safe.
  56 
  57   // Atomically store to a location
  58   inline static void store    (jbyte    store_value, jbyte*    dest);
  59   inline static void store    (jshort   store_value, jshort*   dest);
  60   inline static void store    (jint     store_value, jint*     dest);
  61   // See comment above about using jlong atomics on 32-bit platforms
  62   inline static void store    (jlong    store_value, jlong*    dest);
  63   inline static void store_ptr(intptr_t store_value, intptr_t* dest);
  64   inline static void store_ptr(void*    store_value, void*     dest);
  65 
  66   inline static void store    (jbyte    store_value, volatile jbyte*    dest);
  67   inline static void store    (jshort   store_value, volatile jshort*   dest);
  68   inline static void store    (jint     store_value, volatile jint*     dest);
  69   // See comment above about using jlong atomics on 32-bit platforms
  70   inline static void store    (jlong    store_value, volatile jlong*    dest);
  71   inline static void store_ptr(intptr_t store_value, volatile intptr_t* dest);
  72   inline static void store_ptr(void*    store_value, volatile void*     dest);
  73 
  74 
  75   inline static jbyte    load(volatile jbyte*    src) { return *src; }
  76   inline static jshort   load(volatile jshort*   src) { return *src; }
  77   inline static jint     load(volatile jint*     src) { return *src; }
  78   // See comment above about using jlong atomics on 32-bit platforms
  79   inline static jlong    load(volatile jlong* src);
  80   inline static intptr_t load_ptr(volatile intptr_t* src) { return *src; }
  81   inline static void*    load_ptr(volatile void*     src) { return *(void* volatile*)src; }
  82 
  83   // Atomically add to a location. Returns updated value. add*() provide:
  84   // <fence> add-value-to-dest <membar StoreLoad|StoreStore>
  85   inline static jshort   add    (jshort   add_value, volatile jshort*   dest);
  86   inline static jint     add    (jint     add_value, volatile jint*     dest);
  87   inline static size_t   add    (size_t   add_value, volatile size_t*   dest);
  88   inline static intptr_t add_ptr(intptr_t add_value, volatile intptr_t* dest);
  89   inline static void*    add_ptr(intptr_t add_value, volatile void*     dest);
  90 
  91   // Atomically increment location. inc*() provide:
  92   // <fence> increment-dest <membar StoreLoad|StoreStore>
  93   inline static void inc    (volatile jint*     dest);
  94   inline static void inc    (volatile jshort*   dest);
  95   inline static void inc    (volatile size_t*   dest);
  96   inline static void inc_ptr(volatile intptr_t* dest);
  97   inline static void inc_ptr(volatile void*     dest);
  98 
  99   // Atomically decrement a location. dec*() provide:
 100   // <fence> decrement-dest <membar StoreLoad|StoreStore>
 101   inline static void dec    (volatile jint*     dest);


< prev index next >