home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_08_08
/
8n08045a
< prev
next >
Wrap
Text File
|
1990-07-18
|
556b
|
36 lines
func(int type)
{
/* Begin critical section */
lock();
switch(type)
{
case 1:
/*** Do work for type code 1 ***/
/*** End critical section ***/
unlock();
return(SUCCESS);
case 2:
/*** Do work for type code 2 ***/
/*** End critical section ***/
unlock();
return(SUCCESS);
default:
if(type > 5)
{
/*** End critical section ***/
unlock();
return(ERROR);
}
/*** Do default work ***/
/*** End critical section ***/
unlock();
return(SUCCESS);
}
}