/* This file is part of drd, a thread error detector. Copyright (C) 2006-2009 Bart Van Assche . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. The GNU General Public License is contained in the file COPYING. */ #ifndef __THREAD_H #define __THREAD_H /* Include directives. */ #include "drd_basics.h" #include "drd_segment.h" #include "pub_drd_bitmap.h" #include "pub_tool_libcassert.h" // tl_assert() #include "pub_tool_stacktrace.h" // StackTrace #include "pub_tool_threadstate.h" // VG_N_THREADS /* Defines. */ #define DRD_N_THREADS VG_N_THREADS #define DRD_INVALID_THREADID 0 /* Note: the PThreadId typedef and the INVALID_POSIX_THREADID depend on the */ /* operating system and threading library in use. PThreadId must contain at */ /* least the same number of bits as pthread_t, and INVALID_POSIX_THREADID */ /* must be a value that will never be returned by pthread_self(). */ #define INVALID_POSIX_THREADID ((PThreadId)0) /* Type definitions. */ typedef UWord PThreadId; typedef struct { Segment* first; Segment* last; ThreadId vg_threadid; PThreadId pt_threadid; Addr stack_min_min; /**< Lowest value stack pointer ever had. */ Addr stack_min; /**< Current stack pointer. */ Addr stack_startup; /**