blob: 28068a7beebaec6f68697cf354ca3f20299f206c [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
bartd4bab992013-10-04 05:55:30 +00004 Copyright (C) 2006-2013 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"
bartf00a85b2008-03-13 18:49:23 +000032#include "drd_segment.h"
bartd59bb0f2008-06-08 08:08:31 +000033#include "pub_drd_bitmap.h"
bart86a87df2009-03-04 19:26:47 +000034#include "pub_tool_libcassert.h" /* tl_assert() */
35#include "pub_tool_stacktrace.h" /* typedef StackTrace */
36#include "pub_tool_threadstate.h" /* VG_N_THREADS */
bartf00a85b2008-03-13 18:49:23 +000037
38
bart324a23b2009-02-15 12:14:52 +000039/* Defines. */
bartf00a85b2008-03-13 18:49:23 +000040
bart86a87df2009-03-04 19:26:47 +000041/** Maximum number of threads DRD keeps information about. */
bartf00a85b2008-03-13 18:49:23 +000042#define DRD_N_THREADS VG_N_THREADS
sewardjaf44c822007-11-25 14:01:38 +000043
bart86a87df2009-03-04 19:26:47 +000044/** A number different from any valid DRD thread ID. */
sewardjaf44c822007-11-25 14:01:38 +000045#define DRD_INVALID_THREADID 0
46
bart86a87df2009-03-04 19:26:47 +000047/**
48 * A number different from any valid POSIX thread ID.
49 *
50 * @note The PThreadId typedef and the INVALID_POSIX_THREADID depend on the
51 * operating system and threading library in use. PThreadId must contain at
52 * least as many bits as pthread_t, and INVALID_POSIX_THREADID
53 * must be a value that will never be returned by pthread_self().
54 */
sewardjaf44c822007-11-25 14:01:38 +000055#define INVALID_POSIX_THREADID ((PThreadId)0)
56
57
bart324a23b2009-02-15 12:14:52 +000058/* Type definitions. */
bartf00a85b2008-03-13 18:49:23 +000059
bart86a87df2009-03-04 19:26:47 +000060/**
61 * POSIX thread ID. The type PThreadId must be at least as wide as
62 * pthread_t.
63 */
sewardjaf44c822007-11-25 14:01:38 +000064typedef UWord PThreadId;
65
bart86a87df2009-03-04 19:26:47 +000066/** Per-thread information managed by DRD. */
bartf00a85b2008-03-13 18:49:23 +000067typedef struct
68{
bart91b7ec32012-01-25 20:36:27 +000069 struct segment* sg_first;/**< Segment list. */
70 struct segment* sg_last;
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. */
florian19f91bb2012-11-10 22:29:54 +000078 HChar 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. */
florian1e802b62015-02-13 19:08:26 +0000116extern ThreadInfo* DRD_(g_threadinfo);
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);
bart9cdc0832014-08-09 12:58:17 +0000119extern Bool DRD_(verify_conflict_set);
bartf00a85b2008-03-13 18:49:23 +0000120
121
bart324a23b2009-02-15 12:14:52 +0000122/* Function declarations. */
sewardjaf44c822007-11-25 14:01:38 +0000123
bart62a784c2009-02-15 13:11:14 +0000124void DRD_(thread_trace_context_switches)(const Bool t);
125void DRD_(thread_trace_conflict_set)(const Bool t);
bart8f822af2009-06-08 18:20:42 +0000126void DRD_(thread_trace_conflict_set_bm)(const Bool t);
bart09dc13f2009-02-14 15:13:31 +0000127Bool DRD_(thread_get_trace_fork_join)(void);
128void DRD_(thread_set_trace_fork_join)(const Bool t);
bart62a784c2009-02-15 13:11:14 +0000129void DRD_(thread_set_segment_merging)(const Bool m);
bart8f822af2009-06-08 18:20:42 +0000130int DRD_(thread_get_segment_merge_interval)(void);
131void DRD_(thread_set_segment_merge_interval)(const int i);
bart6d956dc2011-07-28 09:54:37 +0000132void DRD_(thread_set_join_list_vol)(const int jlv);
sewardjaf44c822007-11-25 14:01:38 +0000133
barte278ab52012-01-24 18:28:55 +0000134void DRD_(thread_init)(void);
bart62a784c2009-02-15 13:11:14 +0000135DrdThreadId DRD_(VgThreadIdToDrdThreadId)(const ThreadId tid);
136DrdThreadId DRD_(NewVgThreadIdToDrdThreadId)(const ThreadId tid);
137DrdThreadId DRD_(PtThreadIdToDrdThreadId)(const PThreadId tid);
138ThreadId DRD_(DrdThreadIdToVgThreadId)(const DrdThreadId tid);
139DrdThreadId DRD_(thread_pre_create)(const DrdThreadId creator,
bartbedfd232009-03-26 19:07:15 +0000140 const ThreadId vg_created);
bart62a784c2009-02-15 13:11:14 +0000141DrdThreadId DRD_(thread_post_create)(const ThreadId vg_created);
bart09dc13f2009-02-14 15:13:31 +0000142void DRD_(thread_post_join)(DrdThreadId drd_joiner, DrdThreadId drd_joinee);
bart9194e932011-02-09 11:55:12 +0000143void DRD_(thread_delete)(const DrdThreadId tid, Bool detached);
bart62a784c2009-02-15 13:11:14 +0000144void DRD_(thread_finished)(const DrdThreadId tid);
bart5c7e6b62011-02-03 17:47:50 +0000145void DRD_(drd_thread_atfork_child)(const DrdThreadId tid);
bart62a784c2009-02-15 13:11:14 +0000146void DRD_(thread_pre_cancel)(const DrdThreadId tid);
bartbedfd232009-03-26 19:07:15 +0000147void DRD_(thread_set_stack_startup)(const DrdThreadId tid,
148 const Addr stack_startup);
bart62a784c2009-02-15 13:11:14 +0000149Addr DRD_(thread_get_stack_min)(const DrdThreadId tid);
150Addr DRD_(thread_get_stack_min_min)(const DrdThreadId tid);
151Addr DRD_(thread_get_stack_max)(const DrdThreadId tid);
152SizeT DRD_(thread_get_stack_size)(const DrdThreadId tid);
bart383d6132010-09-02 14:43:18 +0000153Bool DRD_(thread_get_on_alt_stack)(const DrdThreadId tid);
154void DRD_(thread_set_on_alt_stack)(const DrdThreadId tid,
155 const Bool on_alt_stack);
156Int DRD_(thread_get_threads_on_alt_stack)(void);
bart62a784c2009-02-15 13:11:14 +0000157void DRD_(thread_set_pthreadid)(const DrdThreadId tid, const PThreadId ptid);
158Bool DRD_(thread_get_joinable)(const DrdThreadId tid);
159void DRD_(thread_set_joinable)(const DrdThreadId tid, const Bool joinable);
bartdd75cdf2009-07-24 08:20:10 +0000160void DRD_(thread_entering_pthread_create)(const DrdThreadId tid);
161void DRD_(thread_left_pthread_create)(const DrdThreadId tid);
florian19f91bb2012-11-10 22:29:54 +0000162const HChar* DRD_(thread_get_name)(const DrdThreadId tid);
163void DRD_(thread_set_name)(const DrdThreadId tid, const HChar* const name);
bart62a784c2009-02-15 13:11:14 +0000164void DRD_(thread_set_vg_running_tid)(const ThreadId vg_tid);
165void DRD_(thread_set_running_tid)(const ThreadId vg_tid,
bartbedfd232009-03-26 19:07:15 +0000166 const DrdThreadId drd_tid);
bart62a784c2009-02-15 13:11:14 +0000167int DRD_(thread_enter_synchr)(const DrdThreadId tid);
168int DRD_(thread_leave_synchr)(const DrdThreadId tid);
169int DRD_(thread_get_synchr_nesting_count)(const DrdThreadId tid);
170void DRD_(thread_new_segment)(const DrdThreadId tid);
171VectorClock* DRD_(thread_get_vc)(const DrdThreadId tid);
172void DRD_(thread_get_latest_segment)(Segment** sg, const DrdThreadId tid);
bart8f822af2009-06-08 18:20:42 +0000173void DRD_(thread_combine_vc_join)(const DrdThreadId joiner,
174 const DrdThreadId joinee);
bartf6ec1fe2009-06-21 18:07:35 +0000175void DRD_(thread_new_segment_and_combine_vc)(DrdThreadId tid,
176 const Segment* sg);
bart8f822af2009-06-08 18:20:42 +0000177void DRD_(thread_update_conflict_set)(const DrdThreadId tid,
178 const VectorClock* const old_vc);
bartdfbae6e2008-06-05 08:29:53 +0000179
bart23ef19d2011-03-12 12:34:44 +0000180void DRD_(thread_stop_using_mem)(const Addr a1, const Addr a2);
bartd45d9952009-05-31 18:53:54 +0000181void DRD_(thread_set_record_loads)(const DrdThreadId tid, const Bool enabled);
182void DRD_(thread_set_record_stores)(const DrdThreadId tid, const Bool enabled);
bart62a784c2009-02-15 13:11:14 +0000183void DRD_(thread_print_all)(void);
184void DRD_(thread_report_races)(const DrdThreadId tid);
185void DRD_(thread_report_races_segment)(const DrdThreadId tid,
bartbedfd232009-03-26 19:07:15 +0000186 const Segment* const p);
bart62a784c2009-02-15 13:11:14 +0000187void DRD_(thread_report_all_races)(void);
188void DRD_(thread_report_conflicting_segments)(const DrdThreadId tid,
bartbedfd232009-03-26 19:07:15 +0000189 const Addr addr,
190 const SizeT size,
191 const BmAccessTypeT access_type);
bart62a784c2009-02-15 13:11:14 +0000192ULong DRD_(thread_get_context_switch_count)(void);
193ULong DRD_(thread_get_report_races_count)(void);
194ULong DRD_(thread_get_discard_ordered_segments_count)(void);
bart54803fe2009-06-21 09:26:27 +0000195ULong DRD_(thread_get_compute_conflict_set_count)(void);
196ULong DRD_(thread_get_update_conflict_set_count)(void);
barte5214662009-06-21 11:51:23 +0000197ULong DRD_(thread_get_update_conflict_set_new_sg_count)(void);
198ULong DRD_(thread_get_update_conflict_set_sync_count)(void);
199ULong DRD_(thread_get_update_conflict_set_join_count)(void);
bart62a784c2009-02-15 13:11:14 +0000200ULong DRD_(thread_get_conflict_set_bitmap_creation_count)(void);
201ULong DRD_(thread_get_conflict_set_bitmap2_creation_count)(void);
sewardjaf44c822007-11-25 14:01:38 +0000202
203
bart324a23b2009-02-15 12:14:52 +0000204/* Inline function definitions. */
205
bart86a87df2009-03-04 19:26:47 +0000206/**
207 * Whether or not the specified DRD thread ID is valid.
208 *
209 * A DRD thread ID is valid if and only if the following conditions are met:
210 * - The ID is a valid index of the DRD_(g_threadinfo)[] array.
211 * - The ID is not equal to DRD_INVALID_THREADID.
212 * - The ID refers either to a thread known by the Valgrind core, a joinable
213 * thread that has not yet been joined or a detached thread.
214 */
bartbf80e122008-06-06 10:18:24 +0000215static __inline__
bart62a784c2009-02-15 13:11:14 +0000216Bool DRD_(IsValidDrdThreadId)(const DrdThreadId tid)
bartbf80e122008-06-06 10:18:24 +0000217{
bartbedfd232009-03-26 19:07:15 +0000218 return (0 <= (int)tid && tid < DRD_N_THREADS && tid != DRD_INVALID_THREADID
bart6d956dc2011-07-28 09:54:37 +0000219 && (DRD_(g_threadinfo)[tid].valid));
bartbf80e122008-06-06 10:18:24 +0000220}
221
bart86a87df2009-03-04 19:26:47 +0000222/** Returns the DRD thread ID of the currently running thread. */
bart08865622008-06-06 14:31:36 +0000223static __inline__
bart62a784c2009-02-15 13:11:14 +0000224DrdThreadId DRD_(thread_get_running_tid)(void)
bart1ea5fff2008-03-16 08:36:23 +0000225{
bartdd75cdf2009-07-24 08:20:10 +0000226#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
bartbedfd232009-03-26 19:07:15 +0000227 tl_assert(DRD_(g_drd_running_tid) != DRD_INVALID_THREADID);
bartdd75cdf2009-07-24 08:20:10 +0000228#endif
bartbedfd232009-03-26 19:07:15 +0000229 return DRD_(g_drd_running_tid);
bart1ea5fff2008-03-16 08:36:23 +0000230}
231
bart86a87df2009-03-04 19:26:47 +0000232/** Returns a pointer to the conflict set for the currently running thread. */
bart08865622008-06-06 14:31:36 +0000233static __inline__
bart62a784c2009-02-15 13:11:14 +0000234struct bitmap* DRD_(thread_get_conflict_set)(void)
bart1a473c72008-03-13 19:03:38 +0000235{
bartbedfd232009-03-26 19:07:15 +0000236 return DRD_(g_conflict_set);
bart1a473c72008-03-13 19:03:38 +0000237}
238
bart86a87df2009-03-04 19:26:47 +0000239/**
bartdd75cdf2009-07-24 08:20:10 +0000240 * Reports whether or not the currently running client thread is executing code
241 * inside the pthread_create() function.
242 */
243static __inline__
244Bool DRD_(running_thread_inside_pthread_create)(void)
245{
246 return (DRD_(g_threadinfo)[DRD_(g_drd_running_tid)]
247 .pthread_create_nesting_level > 0);
248}
249
250/**
bart31b983d2010-02-21 14:52:59 +0000251 * Reports whether or not recording of memory loads is enabled for the
bartdd75cdf2009-07-24 08:20:10 +0000252 * currently running client thread.
bart86a87df2009-03-04 19:26:47 +0000253 */
bart08865622008-06-06 14:31:36 +0000254static __inline__
bartd45d9952009-05-31 18:53:54 +0000255Bool DRD_(running_thread_is_recording_loads)(void)
bartf00a85b2008-03-13 18:49:23 +0000256{
bart8b4b2ee2008-06-11 13:17:56 +0000257#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
bartbedfd232009-03-26 19:07:15 +0000258 tl_assert(0 <= (int)DRD_(g_drd_running_tid)
259 && DRD_(g_drd_running_tid) < DRD_N_THREADS
260 && DRD_(g_drd_running_tid) != DRD_INVALID_THREADID);
bart589f9482008-06-09 15:08:22 +0000261#endif
bartbedfd232009-03-26 19:07:15 +0000262 return (DRD_(g_threadinfo)[DRD_(g_drd_running_tid)].synchr_nesting == 0
bartd45d9952009-05-31 18:53:54 +0000263 && DRD_(g_threadinfo)[DRD_(g_drd_running_tid)].is_recording_loads);
264}
265
bartdd75cdf2009-07-24 08:20:10 +0000266/**
bart31b983d2010-02-21 14:52:59 +0000267 * Reports whether or not recording memory stores is enabled for the
bartdd75cdf2009-07-24 08:20:10 +0000268 * currently running client thread.
269 */
bartd45d9952009-05-31 18:53:54 +0000270static __inline__
271Bool DRD_(running_thread_is_recording_stores)(void)
272{
273#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
274 tl_assert(0 <= (int)DRD_(g_drd_running_tid)
275 && DRD_(g_drd_running_tid) < DRD_N_THREADS
276 && DRD_(g_drd_running_tid) != DRD_INVALID_THREADID);
277#endif
278 return (DRD_(g_threadinfo)[DRD_(g_drd_running_tid)].synchr_nesting == 0
279 && DRD_(g_threadinfo)[DRD_(g_drd_running_tid)].is_recording_stores);
bart1a473c72008-03-13 19:03:38 +0000280}
281
bart86a87df2009-03-04 19:26:47 +0000282/**
283 * Update the information about the lowest stack address that has ever been
284 * accessed by a thread.
285 */
bart08865622008-06-06 14:31:36 +0000286static __inline__
bart62a784c2009-02-15 13:11:14 +0000287void DRD_(thread_set_stack_min)(const DrdThreadId tid, const Addr stack_min)
bart1ea5fff2008-03-16 08:36:23 +0000288{
bart8b4b2ee2008-06-11 13:17:56 +0000289#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
bartbedfd232009-03-26 19:07:15 +0000290 tl_assert(0 <= (int)tid
291 && tid < DRD_N_THREADS
292 && tid != DRD_INVALID_THREADID);
bart1ea5fff2008-03-16 08:36:23 +0000293#endif
bartbedfd232009-03-26 19:07:15 +0000294 DRD_(g_threadinfo)[tid].stack_min = stack_min;
bart8b4b2ee2008-06-11 13:17:56 +0000295#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
bartbedfd232009-03-26 19:07:15 +0000296 /* This function can be called after the thread has been created but */
297 /* before drd_post_thread_create() has filled in stack_max. */
298 tl_assert(DRD_(g_threadinfo)[tid].stack_min
bartcaefb282014-03-12 14:27:49 +0000299 <= DRD_(g_threadinfo)[tid].stack_max
bartbedfd232009-03-26 19:07:15 +0000300 || DRD_(g_threadinfo)[tid].stack_max == 0);
bart1ea5fff2008-03-16 08:36:23 +0000301#endif
bartbedfd232009-03-26 19:07:15 +0000302 if (UNLIKELY(stack_min < DRD_(g_threadinfo)[tid].stack_min_min))
303 {
304 DRD_(g_threadinfo)[tid].stack_min_min = stack_min;
305 }
bart1ea5fff2008-03-16 08:36:23 +0000306}
307
bart324a23b2009-02-15 12:14:52 +0000308/**
309 * Return true if and only if the specified address is on the stack of the
310 * currently scheduled thread.
bart08865622008-06-06 14:31:36 +0000311 */
312static __inline__
bart62a784c2009-02-15 13:11:14 +0000313Bool DRD_(thread_address_on_stack)(const Addr a)
bart08865622008-06-06 14:31:36 +0000314{
bartbedfd232009-03-26 19:07:15 +0000315 return (DRD_(g_threadinfo)[DRD_(g_drd_running_tid)].stack_min <= a
316 && a < DRD_(g_threadinfo)[DRD_(g_drd_running_tid)].stack_max);
bart08865622008-06-06 14:31:36 +0000317}
318
bart0d6d5c52009-03-10 09:22:13 +0000319/**
320 * Return true if and only if the specified address is on the stack of any
321 * thread.
322 */
323static __inline__
324Bool DRD_(thread_address_on_any_stack)(const Addr a)
325{
florian1e802b62015-02-13 19:08:26 +0000326 UInt i;
bart0d6d5c52009-03-10 09:22:13 +0000327
bartbedfd232009-03-26 19:07:15 +0000328 for (i = 1; i < DRD_N_THREADS; i++)
329 {
330 if (DRD_(g_threadinfo)[i].vg_thread_exists
331 && DRD_(g_threadinfo)[i].stack_min <= a
332 && a < DRD_(g_threadinfo)[i].stack_max)
333 {
334 return True;
335 }
336 }
337 return False;
bart0d6d5c52009-03-10 09:22:13 +0000338}
339
bart1a473c72008-03-13 19:03:38 +0000340/** Return a pointer to the latest segment for the specified thread. */
bart08865622008-06-06 14:31:36 +0000341static __inline__
bart62a784c2009-02-15 13:11:14 +0000342Segment* DRD_(thread_get_segment)(const DrdThreadId tid)
bart1a473c72008-03-13 19:03:38 +0000343{
bart8b4b2ee2008-06-11 13:17:56 +0000344#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
bartbedfd232009-03-26 19:07:15 +0000345 tl_assert(0 <= (int)tid && tid < DRD_N_THREADS
346 && tid != DRD_INVALID_THREADID);
bart91b7ec32012-01-25 20:36:27 +0000347 tl_assert(DRD_(g_threadinfo)[tid].sg_last);
bart589f9482008-06-09 15:08:22 +0000348#endif
bart91b7ec32012-01-25 20:36:27 +0000349 return DRD_(g_threadinfo)[tid].sg_last;
bartf00a85b2008-03-13 18:49:23 +0000350}
351
barta79df6e2008-03-14 17:07:51 +0000352/** Return a pointer to the latest segment for the running thread. */
bart08865622008-06-06 14:31:36 +0000353static __inline__
bart62a784c2009-02-15 13:11:14 +0000354Segment* DRD_(running_thread_get_segment)(void)
barta79df6e2008-03-14 17:07:51 +0000355{
bartbedfd232009-03-26 19:07:15 +0000356 return DRD_(thread_get_segment)(DRD_(g_drd_running_tid));
barta79df6e2008-03-14 17:07:51 +0000357}
bartf00a85b2008-03-13 18:49:23 +0000358
bart86a87df2009-03-04 19:26:47 +0000359#endif /* __THREAD_H */