diff -C 2 -P -r pmpthreads-1.8.8.ORIG/pthreads/GNUmakefile.inc pmpthreads-1.8.8/pthreads/GNUmakefile.inc
*** pmpthreads-1.8.8.ORIG/pthreads/GNUmakefile.inc	Mon Apr 26 14:14:45 1999
--- pmpthreads-1.8.8/pthreads/GNUmakefile.inc	Mon Apr 26 14:15:51 1999
***************
*** 4,7 ****
--- 4,9 ----
  VPATH := $(VPATH):${srcdir}/pthreads
  
+ CFLAGS+= -DTDI_SUPPORT
+ 
  SRCS:= cleanup.c cond.c fd.c fd_kern.c fd_pipe.c fd_sysv.c file.c globals.c \
         malloc.c mutex.c pthread.c pthread_attr.c queue.c signal.c machdep.c \
***************
*** 10,14 ****
         pthread_init.c init.cc sig.c info.c mutexattr.c select.c wrapper.c \
         dump_state.c pthread_kill.c stat.c readv.c writev.c condattr.c \
!        pthread_cancel.c panic.c $(SRCS)
  
  ifeq ($(HAVE_SYSCALL_TEMPLATE),yes)
--- 12,16 ----
         pthread_init.c init.cc sig.c info.c mutexattr.c select.c wrapper.c \
         dump_state.c pthread_kill.c stat.c readv.c writev.c condattr.c \
!        pthread_cancel.c panic.c tdi-aux.c tdi-dl.c $(SRCS)
  
  ifeq ($(HAVE_SYSCALL_TEMPLATE),yes)
***************
*** 45,46 ****
--- 47,51 ----
  	rm syscall.i
  	mv a.out syscall.o
+ 
+ 
+ 
diff -C 2 -P -r pmpthreads-1.8.8.ORIG/pthreads/cond.c pmpthreads-1.8.8/pthreads/cond.c
*** pmpthreads-1.8.8.ORIG/pthreads/cond.c	Mon Apr 26 14:14:45 1999
--- pmpthreads-1.8.8/pthreads/cond.c	Mon Apr 26 14:15:51 1999
***************
*** 37,41 ****
  
  #ifndef lint
! static const char rcsid[] = "$Id: cond.c,v 1.68.2.1 1996/03/05 08:29:12 proven Exp $";
  #endif
  
--- 37,41 ----
  
  #ifndef lint
! static const char rcsid[] = "$Id: cond.c,v 1.2 1998/11/15 02:36:53 dschulz Exp dschulz $";
  #endif
  
***************
*** 45,49 ****
  #include <timers.h>
  #include <errno.h>
! 
  #ifndef ETIME
  #define ETIME ETIMEDOUT  
--- 45,51 ----
  #include <timers.h>
  #include <errno.h>
! #ifdef TDI_SUPPORT
! #include "tdi-aux.h"
! #endif
  #ifndef ETIME
  #define ETIME ETIMEDOUT  
***************
*** 124,127 ****
--- 126,134 ----
  	cond->c_flags 	|= COND_FLAGS_INITED;
  	cond->c_type 	= type;
+ 
+ #ifdef TDI_SUPPORT
+ 	TdiCondRegister(cond);
+ #endif
+ 	
  	return(OK);
  }
***************
*** 164,167 ****
--- 171,180 ----
  	pthread_queue_init(&cond->c_queue);
  	cond->c_flags	= 0;
+ 
+ #ifdef TDI_SUPPORT
+ 	TdiCondUnregister(cond);
+ #endif
+ 
+ 
  	return(OK);
  }
diff -C 2 -P -r pmpthreads-1.8.8.ORIG/pthreads/mutex.c pmpthreads-1.8.8/pthreads/mutex.c
*** pmpthreads-1.8.8.ORIG/pthreads/mutex.c	Mon Apr 26 14:14:45 1999
--- pmpthreads-1.8.8/pthreads/mutex.c	Mon Apr 26 14:15:51 1999
***************
*** 37,41 ****
  
  #ifndef lint
! static const char rcsid[] = "$Id: mutex.c,v 1.61 1995/09/29 12:15:06 proven Exp $";
  #endif
  
--- 37,41 ----
  
  #ifndef lint
! static const char rcsid[] = "$Id: mutex.c,v 1.3 1998/12/14 02:39:57 dschulz Exp dschulz $";
  #endif
  
***************
*** 43,47 ****
  #include <stdlib.h>
  #include <errno.h>
! 
  /* ==========================================================================
   * pthread_mutex_is_debug()
--- 43,49 ----
  #include <stdlib.h>
  #include <errno.h>
! #ifdef TDI_SUPPORT
! #include "tdi-aux.h"
! #endif
  /* ==========================================================================
   * pthread_mutex_is_debug()
***************
*** 92,96 ****
  	switch(type) {
      case MUTEX_TYPE_FAST:
!         break;
      case MUTEX_TYPE_STATIC_FAST:
  		pthread_sched_resume();
--- 94,99 ----
  	switch(type) {
      case MUTEX_TYPE_FAST:
! 
!       break;
      case MUTEX_TYPE_STATIC_FAST:
  		pthread_sched_resume();
***************
*** 127,130 ****
--- 130,137 ----
  	mutex->m_type	= type;
  
+ #ifdef TDI_SUPPORT
+ 	TdiMutexRegister(mutex);
+ #endif
+ 
  	pthread_sched_resume();
  	return(OK);
***************
*** 143,147 ****
  	switch(mutex->m_type) {
  	case MUTEX_TYPE_FAST:
! 		break;
  	case MUTEX_TYPE_STATIC_FAST:
  		pthread_sched_resume();
--- 150,154 ----
  	switch(mutex->m_type) {
  	case MUTEX_TYPE_FAST:
! 	  break;
  	case MUTEX_TYPE_STATIC_FAST:
  		pthread_sched_resume();
***************
*** 176,180 ****
  	mutex->m_owner	= NULL;
  	mutex->m_flags	= 0;
! 
  	pthread_sched_resume();
  	return(OK);
--- 183,190 ----
  	mutex->m_owner	= NULL;
  	mutex->m_flags	= 0;
! #ifdef TDI_SUPPORT
! 	/* corresponding to mutex_init */ 
! 	TdiMutexUnregister(mutex);
! #endif
  	pthread_sched_resume();
  	return(OK);
diff -C 2 -P -r pmpthreads-1.8.8.ORIG/pthreads/pthread.c pmpthreads-1.8.8/pthreads/pthread.c
*** pmpthreads-1.8.8.ORIG/pthreads/pthread.c	Mon Apr 26 14:14:45 1999
--- pmpthreads-1.8.8/pthreads/pthread.c	Mon Apr 26 14:15:51 1999
***************
*** 46,49 ****
--- 46,54 ----
  #include <string.h>
  #include <sched.h>
+ #ifdef TDI_SUPPORT
+ #include "tdi.h"
+ #include "tdi-aux.h"
+ #include "tdi-dl.h"
+ #endif
  
  /* ==========================================================================
***************
*** 92,95 ****
--- 97,104 ----
  	pthread_run->ret = status;
  
+ #ifdef TDI_SUPPORT
+ 	TdiThreadUnregister(pthread_run);
+ #endif
+ 
  	/* First execute all cleanup handlers */
  	while (pthread_run->cleanup) {
***************
*** 287,293 ****
           */
  		(*thread) = new_thread;
  	} else {
! 		retval = EAGAIN;
  	}
  	return(retval);
  }
--- 296,312 ----
           */
  		(*thread) = new_thread;
+ 	
+ #ifdef TDI_SUPPORT
+ 		TdiThreadRegister(*thread);
+ #endif
  	} else {
! 	  retval = EAGAIN;
  	}
  	return(retval);
  }
+ 
+ 
+ 
+ 
+ 
+ 
diff -C 2 -P -r pmpthreads-1.8.8.ORIG/pthreads/pthread_init.c pmpthreads-1.8.8/pthreads/pthread_init.c
*** pmpthreads-1.8.8.ORIG/pthreads/pthread_init.c	Mon Apr 26 14:14:45 1999
--- pmpthreads-1.8.8/pthreads/pthread_init.c	Mon Apr 26 14:15:51 1999
***************
*** 40,43 ****
--- 40,49 ----
  #endif
  
+ 
+ #ifdef TDI_SUPPORT
+ #include "tdi.h"
+ #include "tdi-aux.h"
+ #include "tdi-dl.h"
+ #endif
  #include <stdlib.h>
  #include <string.h>
***************
*** 70,73 ****
--- 76,108 ----
  		return;
  	}
+ 
+ #ifdef TDI_SUPPORT
+ 	/* ------------------------------------------------------- *
+ 	 * TDI:                                                    *
+ 	 *      - if we are attached by a debugger, we load the    *
+ 	 *        TDI library                                      *
+ 	 * ------------------------------------------------------- */
+ 	
+ 	if (__pthread_debug_with_TDI>0)
+ 	  {
+ 	    /* load the function code for tdi_server */
+ 	    if (pthread_load_TDI_Server("libTDISrv.so","tdi_server")
+ 		==TDI_LOAD_OK) 
+ 	      {
+ 		/* if TDI_Server_Func is assigned, we can ping *
+ 		 * the TDI kernel to register                  */
+ 		if (TDI_Server_Func) 
+ 		  {
+ 		    /* let the TDI call our register func */
+ 		    TDI_Server_Func(-1,-2);
+ 		  }
+ 	      }
+ 	  }
+ 	/* ------------------------------------------------------- */
+ #endif
+ 	
+ 
+ 
+ 
  
  	pthread_pagesize = getpagesize();
diff -C 2 -P -r pmpthreads-1.8.8.ORIG/pthreads/tdi-aux.c pmpthreads-1.8.8/pthreads/tdi-aux.c
*** pmpthreads-1.8.8.ORIG/pthreads/tdi-aux.c	Thu Jan  1 01:00:00 1970
--- pmpthreads-1.8.8/pthreads/tdi-aux.c	Mon Apr 26 14:15:51 1999
***************
*** 0 ****
--- 1,579 ----
+ #ifdef TDI_SUPPORT
+ 
+ 
+ #include "tdi.h"    
+ #include "tdi-server.h" 
+ #include "tdi-dl.h"       /* this is local */	
+ #include <pthread.h>
+ 
+ #define P(x)
+ 
+ /* FIXME: this should be replaced by a profile entity */
+ 
+ static int persistentID_support=0;
+ 
+ /* implementation type                                *
+  * -> all user level threads are associated with the  *
+  *    same kernel thread                              */
+ 
+ volatile int __pthread_debug_with_TDI = - K2UL_ONE_TO_MANY;
+ 
+ 
+ /* this variable is used to dis- or enable the signal *
+  * handling before running the TDI code               */
+ 
+ volatile int  __pthread_debug_TDI_sig_ignore = -SIGALRM;
+ 
+ /* this bit-field contains the set of ignored signals *
+  * (limted to sizeof(int)*8)                          */
+ 
+ volatile int __pthread_debug_TDI_ignored_signals = 0;
+ 
+ 
+ /* numbering functions used by the thread implementation */
+ 
+ int     (*TdiRegister)     (RelTypeT,ObjRefT)       = NULL;   
+ int     (*TdiUnregister)   (RelTypeT,ObjRefT)       = NULL;   
+ int     (*TdiIsRegistered) (RelTypeT,ObjRefT)       = NULL;   
+ ObjRefT (*TdiGetFirst)     (RelTypeT)              = NULL;           
+ ObjRefT (*TdiGetNext)      (RelTypeT,ObjRefT last)  = NULL; 
+ 
+ 
+ 
+ /* forward decl's for the class specific functions       */
+ 
+ int TdiThreadRegister     (ObjRefT); 
+ int TdiThreadUnregister   (ObjRefT); 
+ int TdiThreadIsRegistered (ObjRefT); 
+ 
+ int TdiMutexRegister      (ObjRefT); 
+ int TdiMutexUnregister    (ObjRefT); 
+ int TdiMutexIsRegistered  (ObjRefT); 
+ ObjRefT TdiGetFirstMutex  ();          
+ ObjRefT TdiGetNextMutex   (ObjRefT last);
+ 
+ int TdiCondRegister       (ObjRefT);   
+ int TdiCondUnregister     (ObjRefT);   
+ int TdiCondIsRegistered   (ObjRefT);   
+ ObjRefT TdiGetFirstCond   ();           
+ ObjRefT TdiGetNextCond    (ObjRefT last); 
+ 
+ /* ----------------------------------------------------------- *
+  *              this is MIT pthreads specific                  *
+  * ----------------------------------------------------------- */
+ 
+ 
+ /* forward decls */
+ 
+ pthread_mutex_t*  mitGetFirstMutex ();
+ pthread_mutex_t*  mitGetNextMutex  (pthread_mutex_t *last);
+ pthread_cond_t*   mitGetFirstCond  ();
+ pthread_cond_t*   mitGetNextCond   (pthread_cond_t* cond);
+ int               mitGetCondID     (pthread_cond_t* cond);
+ int               mitGetCondMutex  (pthread_cond_t* cond);
+ 
+ /* ----------------------------------------------- *
+  * MIT Pthreads Implementation Wrapper for the TDI *
+  * ----------------------------------------------- */
+ 
+ /* List access */
+ 
+ pthread_t  
+ mitGetFirstThread() {
+   return pthread_link_list; 
+ }
+ 
+ pthread_t 
+ mitGetNextThread(pthread_t last) {
+   return last->pll;
+ }
+ 
+ 
+ /* thread entity attributes */
+ 
+ int 
+ mitGetThreadID    (pthread_t thread) {
+ 
+   /* 0 is not an ID */
+   int tid = 0;
+ 
+ 
+   if(thread == NULL)
+     return 0;
+ 
+   if (!persistentID_support) {
+     /* if this implementation provides no persistentID support, we *
+      * have to use the persistentID functions                     */
+ 
+     return ((tid = TdiThreadIsRegistered(thread))?
+ 	    tid :
+ 	    TdiThreadRegister(thread));
+   }
+   else {
+     return (int)thread;
+   }
+ }
+ 
+ int 
+ mitGetThreadAddress(pthread_t thread) {
+   if (thread)
+     return (int) thread;
+ }
+ 
+ 
+ int 
+ mitGetThreadPrio  (pthread_t thread) {
+   if (thread)
+     return thread->pthread_priority;
+ }
+ 
+ 
+ int 
+ mitGetThreadState (pthread_t thread) {
+   int mitState;
+ 
+   if(!thread)
+     return TDI_UNDEF_STATE;
+ 
+   mitState = thread->state; 
+ 
+   /* state translation has to be done to fit the *
+    * states of an abstract thread implementation */
+   
+   if (pthread_equal(pthread_self(),thread)) 
+     return TDI_RUNNING_STATE;
+ 
+   if (mitState == PS_RUNNING)
+     return TDI_READY_STATE;
+ 
+   if (mitState == PS_MUTEX_WAIT) 
+     return TDI_BLOCKED_M_STATE;
+ 
+   if (mitState == PS_COND_WAIT)
+     return TDI_BLOCKED_C_STATE;
+ 
+   if ((mitState == PS_SLEEP_WAIT) 
+       || (mitState ==  PS_WAIT_WAIT) 
+       || (mitState== PS_SIGWAIT))
+     return TDI_BLOCKED_T_STATE;
+ 
+ #if 0 /* not implemented yet */
+   if (mitState & T_SUSPEND)
+     return TDI_BLOCKED_S_STATE;
+ #endif
+ 
+   if (mitState & (PS_DEAD))
+     return TDI_EXITING_STATE;
+ 
+   return TDI_BLOCKED_O_STATE;
+ 
+ }
+ 
+ #if 0
+ 
+ int 
+ mitSetThreadState(pthread_t thread, int NewState) {
+   
+   int retVal=TDI_UNDEF_STATE;
+ 
+ 
+   if (!thread)
+     return retVal;
+ 
+   retVal = mitGetThreadState(thread);
+ 
+   switch (NewState) 
+     {
+       /* suspend */
+     case TDI_BLOCKED_S_STATE:
+       /* only if not suspended yet */
+       if (retVal != TDI_BLOCKED_S_STATE) {
+ 	pthread_suspend_np(thread);
+       }
+       break;
+ 
+       /* resume */
+     case TDI_READY_STATE:
+       /* only if suspended */
+       if (retVal == TDI_BLOCKED_S_STATE) {
+ 	pthread_resume_np(thread);
+       }
+       break;
+     default:
+     }
+   return retVal;
+ }
+ 
+ #endif
+ 
+ int 
+ mitGetThreadRealState (pthread_t thread) {
+   if(thread)
+     return (thread)->state;
+ };
+ 
+ int 
+ mitGetThreadEntry (pthread_t thread) {
+   if (thread) 
+     return (int)(thread->machdep_data.start_routine);	
+ };
+ 
+ int 
+ mitGetThreadEntryArg (pthread_t thread) {
+   if (thread)
+     return (int)thread->machdep_data.start_argument; 
+ }
+ 
+ int 
+ mitGetThreadNewPc (pthread_t thread) {
+ 
+ 
+   /* 
+    *  FIXME: getting the pc of the jmpbuf is machine dependent
+    *         so recognize the used architecture
+    */
+ 
+ 
+   if (thread)
+     return (int)(thread->machdep_data.machdep_state[0].__pc); 
+ }
+ 
+ int
+ mitGetThreadSp (pthread_t thread) {
+   if (thread)
+     return (int)(thread->machdep_data.machdep_state[0].__bp); 
+ }
+ 
+ 
+ int
+ mitGetThreadPID (pthread_t t) {
+ 
+   return (int) getpid();
+ 
+ }
+ 
+ 
+ 
+ int 
+ mitGetThreadMutexBlockedOn (pthread_t thread) {
+   pthread_mutex_t* mutex = mitGetFirstMutex();
+   
+   pthread_t t;
+ 
+   while (mutex) {
+     t = mutex->m_queue.q_next;
+     
+     while (t) {
+       if (pthread_equal(t,thread))
+ 	return mitGetMutexID(mutex);
+ 	t=(pthread_queue_get(t->queue)==t)?NULL:pthread_queue_get(t->queue);
+     }
+     
+     mutex = mitGetNextMutex(mutex);
+   }
+   return 0;
+ 
+ }; 
+ 
+ 
+ int 
+ mitGetThreadCondWaitFor (pthread_t thread) {
+ 
+   pthread_cond_t* cond;
+   pthread_t tmp_thread = NULL,last_thread = NULL;
+   
+   if (!thread)
+     return 0;
+ 
+   /* we search this thread in all CV queues, if one    *
+    * entry is found we can return (a thread waits only *
+    * for one unique CV at a time)                      */
+   
+   cond = mitGetFirstCond();
+ 
+   while(cond) 
+     {
+       tmp_thread = pthread_queue_get(&cond->c_queue);
+       while (tmp_thread != last_thread) 
+ 	{
+ 	  last_thread = tmp_thread;
+ 	  if (tmp_thread == thread)
+ 	    return mitGetCondID(cond);
+ 	  tmp_thread = pthread_queue_get(&cond->c_queue);
+ 	} 
+       cond = mitGetNextCond(cond);
+     }
+ };
+ 
+ 
+ 
+ /* mutex access */
+ pthread_mutex_t*  
+ mitGetFirstMutex() {
+ 
+ 
+ #if 0
+   /* get hidden mutexes from cond->mutex */
+   {
+     pthread_cond_t* cond;
+     cond = mitGetFirstCond();
+     while (cond) {
+       mitGetCondMutex(cond); /* trigger it */
+       cond = mitGetNextCond(cond);
+     }
+   }
+ #endif
+ 
+   /* only one list type */
+   if (TdiGetFirstMutex) {
+     return (pthread_mutex_t*)TdiGetFirstMutex();
+   }
+ 
+   return NULL;
+ 
+ }
+ 
+ pthread_mutex_t* 
+ mitGetNextMutex(pthread_mutex_t *last) {
+ 
+   /* only one list type */
+   if (TdiGetNextMutex) {
+     return (pthread_mutex_t*)TdiGetNextMutex(last);
+   }
+ 
+   return NULL;
+ }
+ 
+ int 
+ mitGetMutexID(pthread_mutex_t* mutex) {
+   /* all mutexes are registered */
+ 
+   if (!mutex)
+     return 0;
+ 
+   return TdiMutexIsRegistered(mutex);
+ }
+ 
+ int 
+ mitGetMutexAddress(pthread_mutex_t* mutex) {
+   /* FIXME:
+    * before release it, we have to find the correct *
+    * return type with sizeof(void*)                 */
+   return (int)mutex;
+ }
+ 
+ int 
+ mitGetMutexOwner(pthread_mutex_t* mutex) {
+ 
+   if (mutex->m_owner) {
+     return mitGetThreadID(mutex->m_owner);
+   }
+   return 0;
+ }
+ 
+ 
+ /* condition variables */
+ pthread_cond_t*  
+ mitGetFirstCond() {
+ 
+   /* only one list type */
+   if (TdiGetFirstCond) {
+     return (pthread_cond_t*)TdiGetFirstCond();
+   }
+ 
+   return NULL;
+ 
+ }
+ 
+ pthread_cond_t* 
+ mitGetNextCond(pthread_cond_t *last) {
+ 
+   /* only one list type */
+   if (TdiGetNextCond) {
+     return (pthread_cond_t*)TdiGetNextCond(last);
+   }
+ 
+   return NULL;
+ }
+ 
+ int
+ mitGetCondID(pthread_cond_t* cond) {
+ 
+   int ID=0;
+ 
+   if (!cond)
+     return 0;
+   
+   if (!(ID=TdiCondIsRegistered(cond)))
+     return TdiCondRegister(cond);
+ 
+   return ID;
+ 
+ }
+ 
+ int 
+ mitGetCondAddr(pthread_cond_t* cond) {
+   return (int)cond;
+ }
+ 
+ int
+ mitGetCondMutex(pthread_cond_t* cond) {
+   int ID = 0;
+   pthread_mutex_t* mutex = NULL;
+   pthread_t        thread = NULL;
+   pthread_t        last_thread = NULL;
+ 
+   /* - getting THE associated mutex for a cond
+    *   is not very easy
+    * - it could not be assumed that there i sa 1:n 
+    *   relationship between mutexes an condition 
+    *   variables 
+    */
+   
+   /* run through the thread list */
+   thread = pthread_queue_get(&cond->c_queue);
+   
+   while (thread != last_thread) {
+     last_thread = thread;
+     if (!mutex) 
+       {
+ 	mutex = thread->data.mutex;
+       }
+     else
+       {
+ 	if (mutex != thread->data.mutex) {
+ 	  return 0;
+ 	}
+       }
+     /* get the next entry of the queue *
+      * thread is currently queued in   */
+     thread = pthread_queue_get(thread->queue);
+   }
+   
+   
+   if (!(ID=TdiMutexIsRegistered(mutex)))
+     return TdiMutexRegister(mutex);
+   
+   return ID;
+ }
+ 
+ #define REG_ATTR_READ(func,attr,entity) TDIAuxFuncs->SetAttrFunc(entity,attr,(int (*)(void*))func,NULL)
+ 
+ #define REG_ATTR_WRITE(func,attr,entity) TDIAuxFuncs->SetAttrFunc(entity,attr,NULL, (int (*)(ObjRefT,AttrDomainT)) func)
+ 
+ #define REG_ITERATORS(entity,gF,gN) TDIAuxFuncs->SetIterFuncs(entity,(void* (*)())gF,(void* (*)(void*))gN)
+ 
+ 
+ /* this function is mandatory */
+ 
+ void 
+ pthread_TDI_register(TDIAuxFuncs)       /* <IN>  TDI helper functions   */
+      TDIAuxFuncsT* TDIAuxFuncs;
+ {
+   
+   /* get TDI helper funtions */ 
+ 
+   TdiRegister       = TDIAuxFuncs->RegisterObject;
+   TdiUnregister     = TDIAuxFuncs->UnregisterObject;
+   TdiIsRegistered   = TDIAuxFuncs->IsRegistered;
+   /* iterator */
+   TdiGetFirst       = TDIAuxFuncs->GetFirstObject;
+   TdiGetNext        = TDIAuxFuncs->GetNextObject;
+   
+   /* we register our attribute access functions */
+   
+   
+   if (TDIAuxFuncs->SetAttrFunc && TDIAuxFuncs->SetIterFuncs) {
+     
+     /* register thread iterators */
+     REG_ITERATORS(ET_THREAD,mitGetFirstThread,mitGetNextThread);
+       
+     /* register thread attribute access functions */
+       
+     REG_ATTR_READ (mitGetThreadID,              TA_ID      ,ET_THREAD);    
+     REG_ATTR_READ (mitGetThreadAddress,         TA_ADDR    ,ET_THREAD);   
+     REG_ATTR_READ (mitGetThreadPrio,            TA_PRIO    ,ET_THREAD);   
+     REG_ATTR_READ (mitGetThreadState,           TA_STATE   ,ET_THREAD);   
+ #if 0
+     REG_ATTR_WRITE(mitSetThreadState,           TA_STATE   ,ET_THREAD);   
+ #endif
+     REG_ATTR_READ (mitGetThreadRealState,       TA_RSTATE  ,ET_THREAD);   
+     REG_ATTR_READ (mitGetThreadEntry,           TA_ENTRY   ,ET_THREAD);   
+     REG_ATTR_READ (mitGetThreadEntryArg,        TA_ENTRYARG,ET_THREAD);   
+     REG_ATTR_READ (mitGetThreadNewPc,           TA_NEWPC   ,ET_THREAD);  
+     REG_ATTR_READ (mitGetThreadSp,              TA_SP      ,ET_THREAD);   
+     REG_ATTR_READ (mitGetThreadMutexBlockedOn,  TA_MBO     ,ET_THREAD);
+     REG_ATTR_READ (mitGetThreadCondWaitFor   ,  TA_CVWF    ,ET_THREAD);
+     REG_ATTR_READ (mitGetThreadPID           ,  TA_PID     ,ET_THREAD);
+       
+     /* register mutex iterators */
+     REG_ITERATORS(ET_MUTEX,mitGetFirstMutex,mitGetNextMutex);
+       
+     /* register mutex attribute access functions */
+     REG_ATTR_READ(mitGetMutexID,      MA_ID    , ET_MUTEX);
+     REG_ATTR_READ(mitGetMutexAddress, MA_ADDR  , ET_MUTEX);
+     REG_ATTR_READ(mitGetMutexOwner,   MA_OWNER , ET_MUTEX);
+       
+     /* register CV iterators */
+     REG_ITERATORS(ET_COND,mitGetFirstCond,mitGetNextCond);
+       
+     /* register CV attribute access functions */
+     REG_ATTR_READ(mitGetCondID  ,  CA_ID    , ET_COND);       
+     REG_ATTR_READ(mitGetCondAddr,  CA_ADDR  , ET_COND);
+     REG_ATTR_READ(mitGetCondMutex, CA_MUTEX , ET_COND);
+       
+   }
+     
+ }
+ 
+ /* this stuff is generic for all pthreads implementaions */
+ 
+ #define TDI_REG(RelType,ORef)   { if (TdiRegister) return TdiRegister(RelType,ORef); else return 0;}
+ 
+ #define TDI_UNREG(RelType,ORef) { if (TdiUnregister) return TdiUnregister(RelType,ORef); else return 0;}
+ 
+ #define TDI_ISREG(RelType,ORef) { if (TdiIsRegistered) return TdiIsRegistered(RelType,ORef); else return 0;}
+ 
+ #define TDI_GET_FIRST(RelType)  { if (TdiGetFirst) return TdiGetFirst(RelType); else return NULL;}
+ 
+ #define TDI_GET_NEXT(RelType,Last) { if (TdiGetNext) return TdiGetNext(RelType, Last); else return NULL; }
+ 
+ int 
+ TdiThreadRegister     (ObjRefT ObjRef) { TDI_REG(ET_THREAD,ObjRef); } 
+ 
+ int 
+ TdiThreadUnregister   (ObjRefT ObjRef) { TDI_UNREG(ET_THREAD,ObjRef);} 
+ 
+ int 
+ TdiThreadIsRegistered (ObjRefT ObjRef) { TDI_ISREG(ET_THREAD,ObjRef);} 
+ 
+ int 
+ TdiMutexRegister      (ObjRefT ObjRef) { TDI_REG(ET_MUTEX,ObjRef); } 
+ 
+ int 
+ TdiMutexUnregister    (ObjRefT ObjRef) { TDI_UNREG(ET_MUTEX,ObjRef);} 
+ 
+ int 
+ TdiMutexIsRegistered  (ObjRefT ObjRef) { TDI_ISREG(ET_MUTEX,ObjRef);} 
+ 
+ ObjRefT 
+ TdiGetFirstMutex  () { TDI_GET_FIRST(ET_MUTEX); }          
+ 
+ ObjRefT 
+ TdiGetNextMutex   (ObjRefT last) { TDI_GET_NEXT(ET_MUTEX,last)}
+ 
+ int 
+ TdiCondRegister       (ObjRefT ObjRef) { TDI_REG(ET_COND,ObjRef); }   
+ 
+ int 
+ TdiCondUnregister     (ObjRefT ObjRef) { TDI_UNREG(ET_COND,ObjRef);}   
+ 
+ int 
+ TdiCondIsRegistered   (ObjRefT ObjRef) { TDI_ISREG(ET_COND,ObjRef);}   
+ 
+ ObjRefT 
+ TdiGetFirstCond   () { TDI_GET_FIRST(ET_COND); }           
+ 
+ ObjRefT 
+ TdiGetNextCond    (ObjRefT last) { TDI_GET_NEXT(ET_COND,last); } 
+ #endif /* TDI_SUPPORT */
diff -C 2 -P -r pmpthreads-1.8.8.ORIG/pthreads/tdi-aux.h pmpthreads-1.8.8/pthreads/tdi-aux.h
*** pmpthreads-1.8.8.ORIG/pthreads/tdi-aux.h	Thu Jan  1 01:00:00 1970
--- pmpthreads-1.8.8/pthreads/tdi-aux.h	Mon Apr 26 14:15:51 1999
***************
*** 0 ****
--- 1,51 ----
+ #ifndef _tdi_aux_h
+ #define _tdi_aux_h
+ 
+ /* implementation type */
+ 
+ extern int __pthread_debug_with_TDI;
+ 
+ /* this is for dis-/enabling signal handling *
+  * by the debugger                           */
+ 
+ extern int __pthread_debug_TDI_sig_ignore; 
+ 
+ /* this is the mask of all signals arrived *
+  * during TDI invocation                   */
+   
+ extern int __pthread_debug_TDI_ignored_signals;
+ 
+ 
+ /* -------------------------------------------------------- *
+  * in this implementation we register pthread_t's, because  *
+  * there are pointers                                       *
+  * -------------------------------------------------------- */
+ 
+ extern int TdiThreadRegister     (void*);
+ extern int TdiThreadUnregister   (void*);
+ extern int TdiThreadIsRegistered (void*);
+ 
+ extern int TdiMutexRegister      (void*);
+ extern int TdiMutexUnregister    (void*);
+ extern int TdiMutexIsRegistered  (void*);
+ 
+ extern int TdiCondRegister       (void*);
+ extern int TdiCondUnregister     (void*);
+ extern int TdiCondIsRegistered   (void*);
+ 
+ #endif
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
+ 
diff -C 2 -P -r pmpthreads-1.8.8.ORIG/pthreads/tdi-dl.c pmpthreads-1.8.8/pthreads/tdi-dl.c
*** pmpthreads-1.8.8.ORIG/pthreads/tdi-dl.c	Thu Jan  1 01:00:00 1970
--- pmpthreads-1.8.8/pthreads/tdi-dl.c	Mon Apr 26 14:15:51 1999
***************
*** 0 ****
--- 1,79 ----
+ #ifdef TDI_SUPPORT
+ /*  dynamic load of the TDI is splitted up from tdi-aux.c,
+  *  because the dlfcn.h file includes the system pthread.h
+  *  file under Solaris -> to avoid declaration errors, we 
+  *  keep the files apart                                 
+  */
+ 
+ #include <stdio.h>
+ #include <dlfcn.h> 
+ 
+ /* if shared libraries are supported, TDI_Server will be *
+  * the function used by the Debugger                     */
+ 
+ int (*TDI_Server_Func) (int,int) = NULL;
+ 
+ /* the debugger has to call pthread_load_TDI_Server before *
+  * interacting with it                                     */
+ 
+ void* libhandle = NULL; 
+ char  shared_libname[100]; /* for debugging */
+ 
+ int
+ pthread_load_TDI_Server(char* shlibname, char* server_symname) {
+   /* libhandle should survive this function */
+   static int sucessfully_loaded = -1;
+   char *i=shlibname;
+ 
+   /* this is a safe strcpy(shared_libname,shlibname) */
+   while(*i) {
+    shared_libname[(int)i-(int)shlibname]=*i;
+    i++;
+   }
+   shared_libname[(int)i-(int)shlibname]='\0';
+ 
+   /* return values:                             *
+    * 0 - o.k.                                   *
+    * 1 - this is a thread implementation, that  *
+    *     does'nt use a TDI-Hook                 *
+    * 2 - error while opening the shared library */
+  
+ #if 1
+   if (sucessfully_loaded != -1)
+     return sucessfully_loaded;
+ #endif
+ 
+   /* open the shared library */
+   libhandle = dlopen(shlibname,
+ 		     RTLD_LAZY
+ 		     /* under LINUX one has to compile *
+ 		      * the threaded app with -rshared */
+ #if defined SOALRIS
+ 		     /* SOLARIS provides a special feature *
+ 		      * to make the own symbol visible     *
+ 		      * to the dynamic linked library      */
+ 		     | RTLD_PARENT
+ #endif
+ 		     ); 
+   if (!libhandle)
+     return (sucessfully_loaded=2);
+   TDI_Server_Func = dlsym(libhandle,server_symname);
+   if (dlerror()!=NULL)
+     return (sucessfully_loaded=2);
+ 
+   return (sucessfully_loaded=0);
+ }     
+ 
+ 
+ int TDI_Server (int a,int b) {
+ 
+  return TDI_Server_Func(a,b);
+ 
+ }
+ #endif
+ 
+ 
+ 
+ 
+ 
+ 
diff -C 2 -P -r pmpthreads-1.8.8.ORIG/pthreads/tdi-dl.h pmpthreads-1.8.8/pthreads/tdi-dl.h
*** pmpthreads-1.8.8.ORIG/pthreads/tdi-dl.h	Thu Jan  1 01:00:00 1970
--- pmpthreads-1.8.8/pthreads/tdi-dl.h	Mon Apr 26 14:15:51 1999
***************
*** 0 ****
--- 1,13 ----
+ 
+ 
+ 
+ /* TDI_Server points to the TDI-Server function */
+ extern int (*TDI_Server_Func) (int,int);
+ 
+ /* load the TDI library */
+ int
+ pthread_load_TDI_Server(char* shlibname, char* server_symname);
+ 
+ 
+ #define TDI_LOAD_OK    0
+ #define TDI_LOAD_ERROR 2 
