You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: idle_sampling_helper.rb
    path of file: ./repos/dd-trace-rb/lib/datadog/profiling/collectors
    
    the code of the file until where you have to start completion: module Datadog
  module Profiling
    module Collectors
      # Used by the Collectors::CpuAndWallTimeWorker to gather samples when the Ruby process is idle.
      # Almost all of this class is implemented as native code.
      #
      # Methods prefixed with _native_ are implemented in `collectors_idle_sampling_helper.c`
      class IdleSamplingHelper
        private

        attr_accessor :failure_exception

    
    
        def start
          @start_stop_mutex.synchronize do
            return if @worker_thread && @worker_thread.alive?

            Datadog.logger.debug { "Starting thread for: #{self}" }

            # The same instance of the IdleSamplingHelper can be reused multiple times, and this resets it back to
            # a pristine state before recreating the worker thread
            self.class._native_reset(self)

            @worker_thread = Thread.new do
              begin
                Thread.current.name = self.class.name

                self.class._native_idle_sampling_loop(self)

                Datadog.logger.debug('IdleSamplingHelper thread stopping cleanly')
              rescue Exception => e # rubocop:disable Lint/RescueException
                @failure_exception = e
                Datadog.logger.warn(
                  'IdleSamplingHelper thread error. ' \
                  "Cause: #{e.class.name} #{e.message} Location: #{Array(e.backtrace).first}"
                )
              end
            end
            @worker_thread.name = self.class.name # Repeated from above to make sure thread gets named asap
            @worker_thread.thread_variable_set(:fork_safe, true)
          end