home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
hcshdemo.zip
/
csh-os2.zip
/
SAMPLES
/
GETPRIO.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-09-28
|
952b
|
32 lines
/***************************************************************************/
/* */
/* */
/* Retrieve and print the current scheduling priority. */
/* Copyright (c) 1990 by Hamilton Laboratories. All rights reserved. */
/* */
/* */
/***************************************************************************/
#include <stdio.h>
#define INCL_DOSPROCESS
#define ushort USHORT
#include <os2.h>
void cdecl main( void )
{
static char *priority_class[] =
{ "",
"Idle Time",
"Regular",
"Time Critical",
"Foreground" };
ushort prio, rc;
# define Class(p) ((p) >> 8)
# define Level(p) ((p) & 0xff)
rc = DosGetPrty(PRTYS_THREAD, &prio, 0);
printf("rc = %d, prio = 0x%04x, class = %s(%d), level = %d\n", rc, prio,
priority_class[Class(prio)], Class(prio), Level(prio));
exit(0);
}