home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
lan
/
critical
/
crittest.prg
< prev
next >
Wrap
Text File
|
1988-07-14
|
1KB
|
38 lines
* This file is to test my new critical process locking procedures
EXTERNAL INITCRIT,STCRIT,ENDCRIT,CLOSCRIT
CLEAR
result = 0
string = "test"
? "Initializing critical error system"
result = INITCRIT(string)
? "Results of initialization: "+IF(result=0,"Open Successful!","Open Failed!")
IF result # 0
? "Failure result number: "+STR(result,4)
WAIT
RETURN
ELSE
? "About to attempt critical error lock."
result = STCRIT()
IF result # 0
? "Locked out of critical section, result number: "+STR(result,4)
ELSE
? "In critical section now!"
WAIT
? "Releasing critical error lock..."
result = ENDCRIT()
IF result # 0
? "Error releasing critical error lock, result number: "+STR(result,4)
ELSE
? "Critical error lock released."
ENDIF
ENDIF
ENDIF
? "Attempting close of critical lock functions..."
result = CLOSCRIT()
IF result # 0
? "Close failed, result number: "+STR(result,4)
ELSE
? "Close successful."
ENDIF
QUIT