home *** CD-ROM | disk | FTP | other *** search
/ HomeWare 14 / HOMEWARE14.bin / os2 / cenv2_19.arj / THREADS.CMD < prev    next >
OS/2 REXX Batch file  |  1994-03-08  |  948b  |  24 lines

  1. EXTPROC CEnvi
  2. /****************************************************************************
  3.  *** Threads.cmd - CEnvi 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.