home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cenvi23.zip / THREADS.CMD < prev    next >
OS/2 REXX Batch file  |  1995-03-28  |  949b  |  24 lines

  1. EXTPROC CEnvi2
  2. /****************************************************************************
  3.  *** Threads.cmd - CEnvi2 program to list all the thread that are runnning ***
  4.  *** ver.1         in all of the precesses in the system.                 ***
  5.  ****************************************************************************/
  6.  
  7. PList = ProcessList(TRUE)
  8. assert( NULL != PList )
  9. Count = 1 + GetArraySpan(PList)
  10. for ( i = 0; i < Count; i++ ) {
  11.    printf("%s\tID = %d, Parent = %d, name = %s\n",
  12.           SplitFileName(PList[i].name).name,PList[i].id,PList[i].parent,PList[i].name)
  13.    Threads = PList[i].Threads
  14.    if ( Threads != NULL ) {
  15.       ThreadCount = 1 + GetArraySpan(Threads);
  16.       for ( j = 0; j < ThreadCount; j++ ) {
  17.          thread = Threads[j]
  18.          printf("   THREAD %d: SysId = %d, Priority = %04X, Status = %d\n",
  19.                 thread.ProcID,thread.SysID,thread.Priority,thread.Status)
  20.       }
  21.    }
  22. }
  23.  
  24.