Class: Ragweed::Wraposx::ThreadInfo::SchedRr

Inherits:
FFI::Struct
  • Object
show all
Includes:
FFIStructInclude
Defined in:
lib/ragweed/wraposx/thread_info.rb

Overview

struct policy_rr_info

int          max_priority;
int         base_priority;
int               quantum;
boolean_t       depressed;
int      depress_priority;

;

Instance Method Summary collapse

Methods included from FFIStructInclude

#method_missing, #methods, #respond_to?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ragweed::FFIStructInclude

Instance Method Details

#dump(&block) ⇒ Object



117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/ragweed/wraposx/thread_info.rb', line 117

def dump(&block)
  maybe_hex = lambda {|a| begin; "\n" + (" " * 9) + block.call(a, 16).hexdump(true)[10..-2]; rescue; ""; end }

  string =<<EOM
  -----------------------------------------------------------------------
  Round Robin Info:
  max_priority:     #{self.max_priority.to_s.rjust(8, "0")} #{maybe_hex.call(self.max_priority)}
  base_priority:    #{self.base_priority.to_s.rjust(8, "0")} #{maybe_hex.call(self.base_priority)}
  quantum:          #{self.quantum.to_s.rjust(8, "0")} #{maybe_hex.call(self.quantum)}
  depressed:        #{(!self.depressed.zero?).to_s.rjust(8, " ")} #{maybe_hex.call(self.depressed)}
  depress_priority: #{self.depress_priority.to_s.rjust(8, "0")} #{maybe_hex.call(self.depressed_priority)}
EOM
end