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 ="  -----------------------------------------------------------------------\n  Round Robin Info:\n  max_priority:     \#{self.max_priority.to_s.rjust(8, \"0\")} \#{maybe_hex.call(self.max_priority)}\n  base_priority:    \#{self.base_priority.to_s.rjust(8, \"0\")} \#{maybe_hex.call(self.base_priority)}\n  quantum:          \#{self.quantum.to_s.rjust(8, \"0\")} \#{maybe_hex.call(self.quantum)}\n  depressed:        \#{(!self.depressed.zero?).to_s.rjust(8, \" \")} \#{maybe_hex.call(self.depressed)}\n  depress_priority: \#{self.depress_priority.to_s.rjust(8, \"0\")} \#{maybe_hex.call(self.depressed_priority)}\n"
end