File: rp_thread.h

package info (click to toggle)
ruby-prof 0.17.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,656 kB
  • sloc: ruby: 5,043; ansic: 2,175; makefile: 6
file content (27 lines) | stat: -rw-r--r-- 1,108 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* Copyright (C) 2005-2013 Shugo Maeda <shugo@ruby-lang.org> and Charlie Savage <cfis@savagexi.com>
   Please see the LICENSE file for copyright and distribution information */

#ifndef __RP_THREAD__
#define __RP_THREAD__

/* Profiling information for a thread. */
typedef struct
{
    VALUE object;                     /* Cache to wrapped object */
    VALUE methods;                    /* Array of RubyProf::MethodInfo */
    VALUE thread_id;                  /* Thread id */
    VALUE fiber_id;                   /* Fiber id */
    st_table* method_table;           /* Methods called in the thread */
    prof_stack_t* stack;              /* Stack of frames */
} thread_data_t;

void rp_init_thread();
st_table * threads_table_create();
thread_data_t* switch_thread(void* prof, VALUE thread_id, VALUE fiber_id);
void threads_table_free(st_table *table);
VALUE prof_thread_wrap(thread_data_t *thread);
void prof_thread_mark(thread_data_t *thread);
int pause_thread(st_data_t key, st_data_t value, st_data_t data);
int unpause_thread(st_data_t key, st_data_t value, st_data_t data);

#endif //__RP_THREAD__