9 #include <mono/utils/mono-threads.h>
13 mono_threads_platform_get_stack_bounds (guint8
**staddr
, size_t *stsize
)
15 /* see GC_push_all_stacks in libgc/aix_irix_threads.c
16 for why we do this; pthread_getattr_np exists only
17 on some versions of AIX and not on PASE, so use a
18 legacy way to get the stack information */
19 struct __pthrdsinfo pi
;
31 res
= pthread_getthrds_np(&pt
, PTHRDSINFO_QUERY_ALL
, &pi
, ps
, rb
, &rbv
);
32 /* FIXME: are these the right values? */
33 *staddr
= (guint8
*)pi
.__pi_stackaddr
;
35 * ruby doesn't use stacksize; see:
36 * github.com/ruby/ruby/commit/a2594be783c727c6034308f5294333752c3845bb
38 *stsize
= pi
.__pi_stackend
- pi
.__pi_stackaddr
;
42 mono_threads_platform_is_main_thread (void)
44 /* returns 1 on main thread, even if the kernel tid is diff */
45 return pthread_self () == 1;
49 mono_native_thread_os_id_get (void)
51 pthread_t t
= pthread_self ();
52 struct __pthrdsinfo ti
;
54 err
= pthread_getthrds_np (&t
, PTHRDSINFO_QUERY_TID
, &ti
, sizeof (struct __pthrdsinfo
), NULL
, &size
);
55 return (guint64
)ti
.__pi_tid
;
60 #include <mono/utils/mono-compiler.h>
62 MONO_EMPTY_SOURCE_FILE (mono_threads_aix
);