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: thread.rb
    path of file: ./repos/truffleruby/src/main/ruby/truffleruby/core
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# Copyright (c) 2014, 2024 Oracle and/or its affiliates. All rights reserved. This
# code is re
    
  def priority=(priority)
    Kernel.raise TypeError, 'priority must be an Integer' unless Primitive.is_a?(priority, Integer)
    priority = -3 if priority < -3
    priority = 3 if priority > 3
    java_priority = PRIORITIES_RUBY_TO_JAVA[priority+3]
    Primitive.thread_set_priority self, java_priority
    priority
  end