< prev index next >

src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp

Print this page
rev 52821 : [mq]: 8214850-rename-vm_operations


  33 #include "jfr/recorder/repository/jfrRepository.hpp"
  34 #include "jfr/recorder/service/jfrPostBox.hpp"
  35 #include "jfr/recorder/service/jfrRecorderService.hpp"
  36 #include "jfr/recorder/stacktrace/jfrStackTraceRepository.hpp"
  37 #include "jfr/recorder/storage/jfrStorage.hpp"
  38 #include "jfr/recorder/storage/jfrStorageControl.hpp"
  39 #include "jfr/recorder/stringpool/jfrStringPool.hpp"
  40 #include "jfr/utilities/jfrAllocation.hpp"
  41 #include "jfr/utilities/jfrTime.hpp"
  42 #include "jfr/writers/jfrJavaEventWriter.hpp"
  43 #include "jfr/utilities/jfrTypes.hpp"
  44 #include "logging/log.hpp"
  45 #include "memory/resourceArea.hpp"
  46 #include "runtime/atomic.hpp"
  47 #include "runtime/handles.inline.hpp"
  48 #include "runtime/mutexLocker.hpp"
  49 #include "runtime/orderAccess.hpp"
  50 #include "runtime/os.hpp"
  51 #include "runtime/safepoint.hpp"
  52 #include "runtime/thread.inline.hpp"
  53 #include "runtime/vm_operations.hpp"
  54 #include "runtime/vmThread.hpp"
  55 
  56 // set data iff *dest == NULL
  57 static bool try_set(void* const data, void** dest, bool clear) {
  58   assert(data != NULL, "invariant");
  59   const void* const current = OrderAccess::load_acquire(dest);
  60   if (current != NULL) {
  61     if (current != data) {
  62       // already set
  63       return false;
  64     }
  65     assert(current == data, "invariant");
  66     if (!clear) {
  67       // recursion disallowed
  68       return false;
  69     }
  70   }
  71   return Atomic::cmpxchg(clear ? NULL : data, dest, current) == current;
  72 }
  73 




  33 #include "jfr/recorder/repository/jfrRepository.hpp"
  34 #include "jfr/recorder/service/jfrPostBox.hpp"
  35 #include "jfr/recorder/service/jfrRecorderService.hpp"
  36 #include "jfr/recorder/stacktrace/jfrStackTraceRepository.hpp"
  37 #include "jfr/recorder/storage/jfrStorage.hpp"
  38 #include "jfr/recorder/storage/jfrStorageControl.hpp"
  39 #include "jfr/recorder/stringpool/jfrStringPool.hpp"
  40 #include "jfr/utilities/jfrAllocation.hpp"
  41 #include "jfr/utilities/jfrTime.hpp"
  42 #include "jfr/writers/jfrJavaEventWriter.hpp"
  43 #include "jfr/utilities/jfrTypes.hpp"
  44 #include "logging/log.hpp"
  45 #include "memory/resourceArea.hpp"
  46 #include "runtime/atomic.hpp"
  47 #include "runtime/handles.inline.hpp"
  48 #include "runtime/mutexLocker.hpp"
  49 #include "runtime/orderAccess.hpp"
  50 #include "runtime/os.hpp"
  51 #include "runtime/safepoint.hpp"
  52 #include "runtime/thread.inline.hpp"
  53 #include "runtime/vmOperations.hpp"
  54 #include "runtime/vmThread.hpp"
  55 
  56 // set data iff *dest == NULL
  57 static bool try_set(void* const data, void** dest, bool clear) {
  58   assert(data != NULL, "invariant");
  59   const void* const current = OrderAccess::load_acquire(dest);
  60   if (current != NULL) {
  61     if (current != data) {
  62       // already set
  63       return false;
  64     }
  65     assert(current == data, "invariant");
  66     if (!clear) {
  67       // recursion disallowed
  68       return false;
  69     }
  70   }
  71   return Atomic::cmpxchg(clear ? NULL : data, dest, current) == current;
  72 }
  73 


< prev index next >