blob: b46a5955e210866c0eaff7b34da09f7922ee06ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#include <ruby.h>
static VALUE
bug_gettid(VALUE self)
{
pid_t tid = gettid();
return PIDT2NUM(tid);
}
void
Init_id(void)
{
VALUE klass = rb_define_module_under(rb_define_module("Bug"), "ThreadID");
rb_define_module_function(klass, "gettid", bug_gettid, 0);
}
|