MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Threads Debugging Library Functions        tdthrgetinfo(3CDB)



NAME
     tdthrgetinfo - get thread information in libcdb  library
     of interfaces

SYNOPSIS
     cc [ flag... ] file... -lcdb [ library... ]
     #include 
     #include 

     tderre tdthrgetinfo(const tdthrhandlet *thp, tdthrinfot *tip);


DESCRIPTION
     The tdthrgetinfo() function  fills  in  the  tdthrinfot
     structure   *tip  with  values for the thread identified by
     thp.


     The tdthrinfot structure contains the following fields:

       typedef struct tdthrinfot {
         tdthragentx    *titap           /* internal process handle */
         unsigned         tiuserflags;     /* value of flags parameter */
         threadt         titid;            /* thread identifier */
         char             *titls;           /* pointer to thread-local storage*/
         paddr            tistartfunc;      /* address of function at which thread
                                                execution began*/
         paddr            tistkbase;        /* base of thread's stack area*/
         int              tistksize;        /* size in bytes of thread's allocated
                                                stack region*/
         paddr            tiroarea;        /* address of ulwpt structure*/
         int              tirosize         /* size of the ulwpt structure in
                                                bytes */
         tdthrstatee   tistate           /* state of the thread */
         uchart          tidbsuspended    /* non-zero if thread suspended by
                                                tdthrdbsuspend*/
         tdthrtypee    titype            /* type of the thread*/
         int              tipc              /* value of thread's program counter*/
         int              tisp              /* value of thread's stack counter*/
         short            tiflags           /* set of special flags used by
                                                libc*/
         int              tipri             /* priority of thread returned by
                                                thrgetprio(3T)*/
         lwpidt          tilid             /* id of light weight process (LWP)
                                                executing this thread*/
         sigsett         tisigmask         /* thread's signal mask.  See
                                                thrsigsetmask(3T)*/
         uchar           titraceme         /* non-zero if event tracing is on*/
         uchart         tipreemptflag     /* non-zero if thread preempted when
                                                last active*/
         uchart         tipirecflag      /* non-zero if thread runs priority
                                               beside regular */



SunOS 5.11          Last change: 20 Oct 1998                    1






Threads Debugging Library Functions        tdthrgetinfo(3CDB)



         sigsett         tipending        /* set of signals pending for this
                                               thread*/
         tdthreventst  tievents         /* bitmap of events enabled for this
                                               thread*/
       } ;



     The titap member is the internal process handle  identify-
     ing the process of which the thread is a member.


     The tiuserflags member is the value of the flags parameter
     passed to thrcreate(3C) when the thread was created.


     The titid member is the thread identifier  for  the  thread
     returned by thrcreate(3C).


     The titls member is the thread's  pointer  to  thread-local
     storage.


     The tistartfunc member is the address of  the  function  at
     which  thread  execution began, as specified when the thread
     was created with thrcreate(3C).


     The tistkbase member is the  base  of  the  thread's  stack
     area.


     The tistksize member is the size in bytes of  the  thread's
     allocated stack region.


     The tiroarea member is the address of the ulwpt structure
     for  this  thread.   Since  accessing  the  ulwpt structure
     directly violates the  encapsulation  provided  by  libcdb,
     this member should generally not be used.  However, it might
     be useful as a prototype for extensions.


     The tistate  member  is  the  state  of  the  thread.   The
     tdthrstatee  enumeration  type  can contain the following
     values:

     TDTHRANYSTATE          This value is  never  returned  by
                               tdthrgetinfo() but is used as a
                               wildcard  to  select  threads   in
                               tdtathriter().



SunOS 5.11          Last change: 20 Oct 1998                    2






Threads Debugging Library Functions        tdthrgetinfo(3CDB)



     TDTHRUNKNOWN            The libcdb library cannot  deter-
                               mine the state of the thread.


     TDTHRSTOPED            The thread has been stopped  by  a
                               call to  thrsuspend(3C).


     TDTHRUN                The thread is runnable, but it  is
                               not currently assigned to an LWP.


     TDTHRACTIVE             The thread is currently  executing
                               on an  LWP.


     TDTHRZOMBIE             The thread has exited, but it  has
                               not yet been deallocated by a call
                               to thrjoin(3C).


     TDTHRSLEP              The thread is not currently  runn-
                               able.


     TDTHRSTOPEDASLEP     The  thread  is  both  blocked  by
                               TDTHRSLEP and stopped by a call
                               to  tdthrdbsuspend(3CDB).



     The tidbsuspended member is non-zero if and only  if  this
     thread  is  currently suspended because the controlling pro-
     cess has called tdthrdbsuspend on it.


     The titype member is  a  type  of  thread.   It  is  either
     TDTHRUSER  for  a user thread (one created by the applica-
     tion), or TDTHRSYSTEM for one created by libc.


     The tipc member  is  the  value  of  the  thread's  program
     counter,  provided  that  the  thread's  tistate  value  is
     TDTHRSLEP, TDTHRSTOPED, or TDTHRSTOPEDASLEP. Oth-
     erwise, the value of this member is undefined.


     The tisp member is the value of the thread's stack pointer,
     provided  that  the thread's tistate value is TDTHRSLEP,
     TDTHRSTOPED,  or  TDTHRSTOPEDASLEP.  Otherwise,  the
     value of this member is undefined.




SunOS 5.11          Last change: 20 Oct 1998                    3






Threads Debugging Library Functions        tdthrgetinfo(3CDB)



     The tiflags member is a set of special flags used by  libc,
     currently of use only to those debugging libc.


     The tipri member is the thread's priority as  it  would  be
     returned by thrgetprio(3C).


     The tilid member is  the  ID  of  the  LWP  executing  this
     thread,  or  the  ID  of  the   LWP  that last executed this
     thread, if this thread is not currently assigned to anLWP.


     The tisigmask member is  this  thread's  signal  mask.  See
     thrsigsetmask(3C).


     The titraceme member is non-zero if and only if event trac-
     ing for this thread is on.


     The tipreemptflag member is non-zero if  and  only  if  the
     thread was preempted the last time it was active.


     The tipirecflag member is non-zero if and only  if  due  to
     priority  inheritance  the  thread is currently running at a
     priority other than its regular priority.


     The tievents member is the bitmap  of  events  enabled  for
     this thread.

RETURN VALUES
     TDOK       The call completed successfully.


     TDBADTH    An invalid thread handle was passed in.


     TDBER    A call to one of the imported interface routines
                 failed.


     TDER      The call did not complete successfully.


ATRIBUTES
     See attributes(5) for description of  the  following  attri-
     butes:





SunOS 5.11          Last change: 20 Oct 1998                    4






Threads Debugging Library Functions        tdthrgetinfo(3CDB)



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     MT-Level                     Safe                        
    


SEE ALSO
     libcdb(3LIB),                        tdtathriter(3CDB),
     tdthrdbsuspend(3CDB),   thrcreate(3C),  thrgetprio(3C),
     thrjoin(3C),  thrsigsetmask(3C),  thrsuspend(3C),  attri-
     butes(5), threads(5)











































SunOS 5.11          Last change: 20 Oct 1998                    5



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™