blob: cfe04d18123df54898be4584747dc8b553f555be [file] [log] [blame]
sewardjaf44c822007-11-25 14:01:38 +00001/*
bart86562bd2009-02-16 19:43:56 +00002 This file is part of drd, a thread error detector.
sewardjaf44c822007-11-25 14:01:38 +00003
bart922304f2011-03-13 12:02:44 +00004 Copyright (C) 2006-2011 Bart Van Assche <bvanassche@acm.org>.
sewardjaf44c822007-11-25 14:01:38 +00005
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307, USA.
20
21 The GNU General Public License is contained in the file COPYING.
22*/
23
24
25#ifndef __THREAD_H
26#define __THREAD_H
27
28
bart324a23b2009-02-15 12:14:52 +000029/* Include directives. */
sewardjaf44c822007-11-25 14:01:38 +000030
bart09dc13f2009-02-14 15:13:31 +000031#include "drd_basics.h"
barte278ab52012-01-24 18:28:55 +000032#include "drd_list.h"
bartf00a85b2008-03-13 18:49:23 +000033#include "drd_segment.h"
bartd59bb0f2008-06-08 08:08:31 +000034#include "pub_drd_bitmap.h"
bart86a87df2009-03-04 19:26:47 +000035#include "pub_tool_libcassert.h" /* tl_assert() */
36#include "pub_tool_stacktrace.h" /* typedef StackTrace */
37#include "pub_tool_threadstate.h" /* VG_N_THREADS */
bartf00a85b2008-03-13 18:49:23 +000038
39
bart324a23b2009-02-15 12:14:52 +000040/* Defines. */
bartf00a85b2008-03-13 18:49:23 +000041
bart86a87df2009-03-04 19:26:47 +000042/** Maximum number of threads DRD keeps information about. */
bartf00a85b2008-03-13 18:49:23 +000043#define DRD_N_THREADS VG_N_THREADS
sewardjaf44c822007-11-25 14:01:38 +000044
bart86a87df2009-03-04 19:26:47 +000045/** A number different from any valid DRD thread ID. */
sewardjaf44c822007-11-25 14:01:38 +000046#define DRD_INVALID_THREADID 0
47
bart86a87df2009-03-04 19:26:47 +000048/**
49 * A number different from any valid POSIX thread ID.
50 *
51 * @note The PThreadId typedef and the INVALID_POSIX_THREADID depend on the
52 * operating system and threading library in use. PThreadId must contain at
53 * least as many bits as pthread_t, and INVALID_POSIX_THREADID
54 * must be a value that will never be returned by pthread_self().
55 */
sewardjaf44c822007-11-25 14:01:38 +000056#define INVALID_POSIX_THREADID ((PThreadId)0)
57
58
bart324a23b2009-02-15 12:14:52 +000059/* Type definitions. */
bartf00a85b2008-03-13 18:49:23 +000060
bart86a87df2009-03-04 19:26:47 +000061/**
62 * POSIX thread ID. The type PThreadId must be at least as wide as
63 * pthread_t.
64 */
sewardjaf44c822007-11-25 14:01:38 +000065typedef UWord PThreadId;
66
bart86a87df2009-03-04 19:26:47 +000067/** Per-thread information managed by DRD. */
bartf00a85b2008-03-13 18:49:23 +000068typedef struct
69{
barte278ab52012-01-24 18:28:55 +000070 struct list_head sg_list;/**< Segment list. */
bartbedfd232009-03-26 19:07:15 +000071 ThreadId vg_threadid; /**< Valgrind thread ID. */
72 PThreadId pt_threadid; /**< POSIX thread ID. */
73 Addr stack_min_min; /**< Lowest value stack pointer ever had. */
74 Addr stack_min; /**< Current stack pointer. */
75 Addr stack_startup; /**<Stack pointer after pthread_create() finished.*/
76 Addr stack_max; /**< Top of stack. */
77 SizeT stack_size; /**< Maximum size of stack. */
bartd45d9952009-05-31 18:53:54 +000078 char name[64]; /**< User-assigned thread name. */
bart383d6132010-09-02 14:43:18 +000079 Bool on_alt_stack;
bart6d956dc2011-07-28 09:54:37 +000080 /** Whether this structure contains valid information. */
81 Bool valid;
bartbedfd232009-03-26 19:07:15 +000082 /** Indicates whether the Valgrind core knows about this thread. */
83 Bool vg_thread_exists;
84 /** Indicates whether there is an associated POSIX thread ID. */
85 Bool posix_thread_exists;
86 /**
87 * If true, indicates that there is a corresponding POSIX thread ID and
88 * a corresponding OS thread that is detached.
89 */
90 Bool detached_posix_thread;
bartd45d9952009-05-31 18:53:54 +000091 /** Wether recording of memory load accesses is currently enabled. */
92 Bool is_recording_loads;
93 /** Wether recording of memory load accesses is currently enabled. */
94 Bool is_recording_stores;
bartdd75cdf2009-07-24 08:20:10 +000095 /** pthread_create() nesting level. */
96 Int pthread_create_nesting_level;
bartbedfd232009-03-26 19:07:15 +000097 /** Nesting level of synchronization functions called by the client. */
98 Int synchr_nesting;
bart6d956dc2011-07-28 09:54:37 +000099 /** Delayed thread deletion sequence number. */
100 unsigned deletion_seq;
bartf00a85b2008-03-13 18:49:23 +0000101} ThreadInfo;
102
103
bart324a23b2009-02-15 12:14:52 +0000104/*
105 * Local variables of drd_thread.c that are declared here such that these
106 * can be accessed by inline functions.
107 */
bartf00a85b2008-03-13 18:49:23 +0000108
bart86a87df2009-03-04 19:26:47 +0000109/**
110 * DRD thread ID of the currently running thread. It is crucial for correct
111 * operation of DRD that this number is always in sync with
112 * VG_(get_running_tid)().
113 */
bart324a23b2009-02-15 12:14:52 +0000114extern DrdThreadId DRD_(g_drd_running_tid);
bart86a87df2009-03-04 19:26:47 +0000115/** Per-thread information managed by DRD. */
bart324a23b2009-02-15 12:14:52 +0000116extern ThreadInfo DRD_(g_threadinfo)[DRD_N_THREADS];
bart86a87df2009-03-04 19:26:47 +0000117/** Conflict set for the currently running thread. */
bart324a23b2009-02-15 12:14:52 +0000118extern struct bitmap* DRD_(g_conflict_set);
bartf00a85b2008-03-13 18:49:23 +0000119
120
bart324a23b2009-02-15 12:14:52 +0000121/* Function declarations. */
sewardjaf44c822007-11-25 14:01:38 +0000122
bart62a784c2009-02-15 13:11:14 +0000123void DRD_(thread_trace_context_switches)(const Bool t);
124void DRD_(thread_trace_conflict_set)(const Bool t);
bart8f822af2009-06-08 18:20:42 +0000125void DRD_(thread_trace_conflict_set_bm)(const Bool t);
bart09dc13f2009-02-14 15:13:31 +0000126Bool DRD_(thread_get_trace_fork_join)(void);
127void DRD_(thread_set_trace_fork_join)(const Bool t);
bart62a784c2009-02-15 13:11:14 +0000128void DRD_(thread_set_segment_merging)(const Bool m);
bart8f822af2009-06-08 18:20:42 +0000129int DRD_(thread_get_segment_merge_interval)(void);
130void DRD_(thread_set_segment_merge_interval)(const int i);
bart6d956dc2011-07-28 09:54:37 +0000131void DRD_(thread_set_join_list_vol)(const int jlv);
sewardjaf44c822007-11-25 14:01:38 +0000132
barte278ab52012-01-24 18:28:55 +0000133void DRD_(thread_init)(void);
bart62a784c2009-02-15 13:11:14 +0000134DrdThreadId DRD_(VgThreadIdToDrdThreadId)(const ThreadId tid);
135DrdThreadId DRD_(NewVgThreadIdToDrdThreadId)(const ThreadId tid);
136DrdThreadId DRD_(PtThreadIdToDrdThreadId)(const PThreadId tid);
137ThreadId DRD_(DrdThreadIdToVgThreadId)(const DrdThreadId tid);
138DrdThreadId DRD_(thread_pre_create)(const DrdThreadId creator,
bartbedfd232009-03-26 19:07:15 +0000139 const ThreadId vg_created);
bart62a784c2009-02-15 13:11:14 +0000140DrdThreadId DRD_(thread_post_create)(const ThreadId vg_created);
bart09dc13f2009-02-14 15:13:31 +0000141void DRD_(thread_post_join)(DrdThreadId drd_joiner, DrdThreadId drd_joinee);
bart9194e932011-02-09 11:55:12 +0000142void DRD_(thread_delete)(const DrdThreadId tid, Bool detached);
bart62a784c2009-02-15 13:11:14 +0000143void DRD_(thread_finished)(const DrdThreadId tid);
bart5c7e6b62011-02-03 17:47:50 +0000144void DRD_(drd_thread_atfork_child)(const DrdThreadId tid);
bart62a784c2009-02-15 13:11:14 +0000145void DRD_(thread_pre_cancel)(const DrdThreadId tid);
bartbedfd232009-03-26 19:07:15 +0000146void DRD_(thread_set_stack_startup)(const DrdThreadId tid,
147 const Addr stack_startup);
bart62a784c2009-02-15 13:11:14 +0000148Addr DRD_(thread_get_stack_min)(const DrdThreadId tid);
149Addr DRD_(thread_get_stack_min_min)(const DrdThreadId tid);
150Addr DRD_(thread_get_stack_max)(const DrdThreadId tid);
151SizeT DRD_(thread_get_stack_size)(const DrdThreadId tid);
bart383d6132010-09-02 14:43:18 +0000152Bool DRD_(thread_get_on_alt_stack)(const DrdThreadId tid);
153void DRD_(thread_set_on_alt_stack)(const DrdThreadId tid,
154 const Bool on_alt_stack);
155Int DRD_(thread_get_threads_on_alt_stack)(void);
bart62a784c2009-02-15 13:11:14 +0000156void DRD_(thread_set_pthreadid)(const DrdThreadId tid, const PThreadId ptid);
157Bool DRD_(thread_get_joinable)(const DrdThreadId tid);
158void DRD_(thread_set_joinable)(const DrdThreadId tid, const Bool joinable);
bartdd75cdf2009-07-24 08:20:10 +0000159void DRD_(thread_entering_pthread_create)(const DrdThreadId tid);
160void DRD_(thread_left_pthread_create)(const DrdThreadId tid);
bartd45d9952009-05-31 18:53:54 +0000161const char* DRD_(thread_get_name)(const DrdThreadId tid);
162void DRD_(thread_set_name)(const DrdThreadId tid, const char* const name);
bart62a784c2009-02-15 13:11:14 +0000163void DRD_(thread_set_vg_running_tid)(const ThreadId vg_tid);
164void DRD_(thread_set_running_tid)(const ThreadId vg_tid,
bartbedfd232009-03-26 19:07:15 +0000165 const DrdThreadId drd_tid);
bart62a784c2009-02-15 13:11:14 +0000166int DRD_(thread_enter_synchr)(const DrdThreadId tid);
167int DRD_(thread_leave_synchr)(const DrdThreadId tid);
168int DRD_(thread_get_synchr_nesting_count)(const DrdThreadId tid);
169void DRD_(thread_new_segment)(const DrdThreadId tid);
170VectorClock* DRD_(thread_get_vc)(const DrdThreadId tid);
171void DRD_(thread_get_latest_segment)(Segment** sg, const DrdThreadId tid);
bart8f822af2009-06-08 18:20:42 +0000172void DRD_(thread_combine_vc_join)(const DrdThreadId joiner,
173 const DrdThreadId joinee);
bartf6ec1fe2009-06-21 18:07:35 +0000174void DRD_(thread_new_segment_and_combine_vc)(DrdThreadId tid,
175 const Segment* sg);
bart8f822af2009-06-08 18:20:42 +0000176void DRD_(thread_update_conflict_set)(const DrdThreadId tid,
177 const VectorClock* const old_vc);
bartdfbae6e2008-06-05 08:29:53 +0000178
bart23ef19d2011-03-12 12:34:44 +0000179void DRD_(thread_stop_using_mem)(const Addr a1, const Addr a2);
bartd45d9952009-05-31 18:53:54 +0000180void DRD_(thread_set_record_loads)(const DrdThreadId tid, const Bool enabled);
181void DRD_(thread_set_record_stores)(const DrdThreadId tid, const Bool enabled);
bart62a784c2009-02-15 13:11:14 +0000182void DRD_(thread_print_all)(void);
183void DRD_(thread_report_races)(const DrdThreadId tid);
184void DRD_(thread_report_races_segment)(const DrdThreadId tid,
bartbedfd232009-03-26 19:07:15 +0000185 const Segment* const p);
bart62a784c2009-02-15 13:11:14 +0000186void DRD_(thread_report_all_races)(void);
187void DRD_(thread_report_conflicting_segments)(const DrdThreadId tid,
bartbedfd232009-03-26 19:07:15 +0000188 const Addr addr,
189 const SizeT size,
190 const BmAccessTypeT access_type);
bart62a784c2009-02-15 13:11:14 +0000191ULong DRD_(thread_get_context_switch_count)(void);
192ULong DRD_(thread_get_report_races_count)(void);
193ULong DRD_(thread_get_discard_ordered_segments_count)(void);
bart54803fe2009-06-21 09:26:27 +0000194ULong DRD_(thread_get_compute_conflict_set_count)(void);
195ULong DRD_(thread_get_update_conflict_set_count)(void);
barte5214662009-06-21 11:51:23 +0000196ULong DRD_(thread_get_update_conflict_set_new_sg_count)(void);
197ULong DRD_(thread_get_update_conflict_set_sync_count)(void);
198ULong DRD_(thread_get_update_conflict_set_join_count)(void);
bart62a784c2009-02-15 13:11:14 +0000199ULong DRD_(thread_get_conflict_set_bitmap_creation_count)(void);
200ULong DRD_(thread_get_conflict_set_bitmap2_creation_count)(void);
sewardjaf44c822007-11-25 14:01:38 +0000201
202
bart324a23b2009-02-15 12:14:52 +0000203/* Inline function definitions. */
204
bart86a87df2009-03-04 19:26:47 +0000205/**
206 * Whether or not the specified DRD thread ID is valid.
207 *
208 * A DRD thread ID is valid if and only if the following conditions are met:
209 * - The ID is a valid index of the DRD_(g_threadinfo)[] array.
210 * - The ID is not equal to DRD_INVALID_THREADID.
211 * - The ID refers either to a thread known by the Valgrind core, a joinable
212 * thread that has not yet been joined or a detached thread.
213 */
bartbf80e122008-06-06 10:18:24 +0000214static __inline__
bart62a784c2009-02-15 13:11:14 +0000215Bool DRD_(IsValidDrdThreadId)(const DrdThreadId tid)
bartbf80e122008-06-06 10:18:24 +0000216{
bartbedfd232009-03-26 19:07:15 +0000217 return (0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID
bart6d956dc2011-07-28 09:54:37 +0000218 && (DRD_(g_threadinfo)[tid].valid));
bartbf80e122008-06-06 10:18:24 +0000219}
220
bart86a87df2009-03-04 19:26:47 +0000221/** Returns the DRD thread ID of the currently running thread. */
bart08865622008-06-06 14:31:36 +0000222static __inline__
bart62a784c2009-02-15 13:11:14 +0000223DrdThreadId DRD_(thread_get_running_tid)(void)
bart1ea5fff2008-03-16 08:36:23 +0000224{
bartdd75cdf2009-07-24 08:20:10 +0000225#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
bartbedfd232009-03-26 19:07:15 +0000226 tl_assert(DRD_(g_drd_running_tid) != DRD_INVALID_THREADID);
bartdd75cdf2009-07-24 08:20:10 +0000227#endif
bartbedfd232009-03-26 19:07:15 +0000228 return DRD_(g_drd_running_tid);
bart1ea5fff2008-03-16 08:36:23 +0000229}
230
bart86a87df2009-03-04 19:26:47 +0000231/** Returns a pointer to the conflict set for the currently running thread. */
bart08865622008-06-06 14:31:36 +0000232static __inline__
bart62a784c2009-02-15 13:11:14 +0000233struct bitmap* DRD_(thread_get_conflict_set)(void)
bart1a473c72008-03-13 19:03:38 +0000234{
bartbedfd232009-03-26 19:07:15 +0000235 return DRD_(g_conflict_set);
bart1a473c72008-03-13 19:03:38 +0000236}
237
bart86a87df2009-03-04 19:26:47 +0000238/**
bartdd75cdf2009-07-24 08:20:10 +0000239 * Reports whether or not the currently running client thread is executing code
240 * inside the pthread_create() function.
241 */
242static __inline__
243Bool DRD_(running_thread_inside_pthread_create)(void)
244{
245 return (DRD_(g_threadinfo)[DRD_(g_drd_running_tid)]
246 .pthread_create_nesting_level > 0);
247}
248
249/**
bart31b983d2010-02-21 14:52:59 +0000250 * Reports whether or not recording of memory loads is enabled for the
bartdd75cdf2009-07-24 08:20:10 +0000251 * currently running client thread.
bart86a87df2009-03-04 19:26:47 +0000252 */
bart08865622008-06-06 14:31:36 +0000253static __inline__
bartd45d9952009-05-31 18:53:54 +0000254Bool DRD_(running_thread_is_recording_loads)(void)
bartf00a85b2008-03-13 18:49:23 +0000255{
bart8b4b2ee2008-06-11 13:17:56 +0000256#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
bartbedfd232009-03-26 19:07:15 +0000257 tl_assert(0 <= (int)DRD_(g_drd_running_tid)
258 && DRD_(g_drd_running_tid) < DRD_N_THREADS
259 && DRD_(g_drd_running_tid) != DRD_INVALID_THREADID);
bart589f9482008-06-09 15:08:22 +0000260#endif
bartbedfd232009-03-26 19:07:15 +0000261 return (DRD_(g_threadinfo)[DRD_(g_drd_running_tid)].synchr_nesting == 0
bartd45d9952009-05-31 18:53:54 +0000262 && DRD_(g_threadinfo)[DRD_(g_drd_running_tid)].is_recording_loads);
263}
264
bartdd75cdf2009-07-24 08:20:10 +0000265/**
bart31b983d2010-02-21 14:52:59 +0000266 * Reports whether or not recording memory stores is enabled for the
bartdd75cdf2009-07-24 08:20:10 +0000267 * currently running client thread.
268 */
bartd45d9952009-05-31 18:53:54 +0000269static __inline__
270Bool DRD_(running_thread_is_recording_stores)(void)
271{
272#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
273 tl_assert(0 <= (int)DRD_(g_drd_running_tid)
274 && DRD_(g_drd_running_tid) < DRD_N_THREADS
275 && DRD_(g_drd_running_tid) != DRD_INVALID_THREADID);
276#endif
277 return (DRD_(g_threadinfo)[DRD_(g_drd_running_tid)].synchr_nesting == 0
278 && DRD_(g_threadinfo)[DRD_(g_drd_running_tid)].is_recording_stores);
bart1a473c72008-03-13 19:03:38 +0000279}
280
bart86a87df2009-03-04 19:26:47 +0000281/**
282 * Update the information about the lowest stack address that has ever been
283 * accessed by a thread.
284 */
bart08865622008-06-06 14:31:36 +0000285static __inline__
bart62a784c2009-02-15 13:11:14 +0000286void DRD_(thread_set_stack_min)(const DrdThreadId tid, const Addr stack_min)
bart1ea5fff2008-03-16 08:36:23 +0000287{
bart8b4b2ee2008-06-11 13:17:56 +0000288#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
bartbedfd232009-03-26 19:07:15 +0000289 tl_assert(0 <= (int)tid
290 && tid < DRD_N_THREADS
291 && tid != DRD_INVALID_THREADID);
bart1ea5fff2008-03-16 08:36:23 +0000292#endif
bartbedfd232009-03-26 19:07:15 +0000293 DRD_(g_threadinfo)[tid].stack_min = stack_min;
bart8b4b2ee2008-06-11 13:17:56 +0000294#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
bartbedfd232009-03-26 19:07:15 +0000295 /* This function can be called after the thread has been created but */
296 /* before drd_post_thread_create() has filled in stack_max. */
297 tl_assert(DRD_(g_threadinfo)[tid].stack_min
298 < DRD_(g_threadinfo)[tid].stack_max
299 || DRD_(g_threadinfo)[tid].stack_max == 0);
bart1ea5fff2008-03-16 08:36:23 +0000300#endif
bartbedfd232009-03-26 19:07:15 +0000301 if (UNLIKELY(stack_min < DRD_(g_threadinfo)[tid].stack_min_min))
302 {
303 DRD_(g_threadinfo)[tid].stack_min_min = stack_min;
304 }
bart1ea5fff2008-03-16 08:36:23 +0000305}
306
bart324a23b2009-02-15 12:14:52 +0000307/**
308 * Return true if and only if the specified address is on the stack of the
309 * currently scheduled thread.
bart08865622008-06-06 14:31:36 +0000310 */
311static __inline__
bart62a784c2009-02-15 13:11:14 +0000312Bool DRD_(thread_address_on_stack)(const Addr a)
bart08865622008-06-06 14:31:36 +0000313{
bartbedfd232009-03-26 19:07:15 +0000314 return (DRD_(g_threadinfo)[DRD_(g_drd_running_tid)].stack_min <= a
315 && a < DRD_(g_threadinfo)[DRD_(g_drd_running_tid)].stack_max);
bart08865622008-06-06 14:31:36 +0000316}
317
bart0d6d5c52009-03-10 09:22:13 +0000318/**
319 * Return true if and only if the specified address is on the stack of any
320 * thread.
321 */
322static __inline__
323Bool DRD_(thread_address_on_any_stack)(const Addr a)
324{
bartbedfd232009-03-26 19:07:15 +0000325 int i;
bart0d6d5c52009-03-10 09:22:13 +0000326
bartbedfd232009-03-26 19:07:15 +0000327 for (i = 1; i < DRD_N_THREADS; i++)
328 {
329 if (DRD_(g_threadinfo)[i].vg_thread_exists
330 && DRD_(g_threadinfo)[i].stack_min <= a
331 && a < DRD_(g_threadinfo)[i].stack_max)
332 {
333 return True;
334 }
335 }
336 return False;
bart0d6d5c52009-03-10 09:22:13 +0000337}
338
bart1a473c72008-03-13 19:03:38 +0000339/** Return a pointer to the latest segment for the specified thread. */
bart08865622008-06-06 14:31:36 +0000340static __inline__
bart62a784c2009-02-15 13:11:14 +0000341Segment* DRD_(thread_get_segment)(const DrdThreadId tid)
bart1a473c72008-03-13 19:03:38 +0000342{
barte278ab52012-01-24 18:28:55 +0000343 struct list_head* sg_list;
344
bart8b4b2ee2008-06-11 13:17:56 +0000345#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
bartbedfd232009-03-26 19:07:15 +0000346 tl_assert(0 <= (int)tid && tid < DRD_N_THREADS
347 && tid != DRD_INVALID_THREADID);
bart589f9482008-06-09 15:08:22 +0000348#endif
barte278ab52012-01-24 18:28:55 +0000349 sg_list = &DRD_(g_threadinfo)[tid].sg_list;
350#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
351 tl_assert(!list_empty(sg_list));
352#endif
353 return list_last_entry(sg_list, Segment, thr_list);
bartf00a85b2008-03-13 18:49:23 +0000354}
355
barta79df6e2008-03-14 17:07:51 +0000356/** Return a pointer to the latest segment for the running thread. */
bart08865622008-06-06 14:31:36 +0000357static __inline__
bart62a784c2009-02-15 13:11:14 +0000358Segment* DRD_(running_thread_get_segment)(void)
barta79df6e2008-03-14 17:07:51 +0000359{
bartbedfd232009-03-26 19:07:15 +0000360 return DRD_(thread_get_segment)(DRD_(g_drd_running_tid));
barta79df6e2008-03-14 17:07:51 +0000361}
bartf00a85b2008-03-13 18:49:23 +0000362
bart86a87df2009-03-04 19:26:47 +0000363#endif /* __THREAD_H */