home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / lan / critical / crittest.prg < prev    next >
Text File  |  1988-07-14  |  1KB  |  38 lines

  1. * This file is to test my new critical process locking procedures
  2. EXTERNAL INITCRIT,STCRIT,ENDCRIT,CLOSCRIT
  3. CLEAR
  4. result = 0
  5. string = "test"
  6. ? "Initializing critical error system"
  7. result = INITCRIT(string)
  8. ? "Results of initialization: "+IF(result=0,"Open Successful!","Open Failed!")
  9. IF result # 0
  10.    ? "Failure result number: "+STR(result,4)
  11.    WAIT
  12.    RETURN
  13. ELSE
  14.    ? "About to attempt critical error lock."
  15.    result = STCRIT()
  16.    IF result # 0
  17.       ? "Locked out of critical section, result number: "+STR(result,4)
  18.    ELSE
  19.       ? "In critical section now!"
  20.       WAIT
  21.       ? "Releasing critical error lock..."
  22.       result = ENDCRIT()
  23.       IF result # 0
  24.      ? "Error releasing critical error lock, result number: "+STR(result,4)
  25.       ELSE
  26.      ? "Critical error lock released."
  27.       ENDIF
  28.    ENDIF
  29. ENDIF
  30. ? "Attempting close of critical lock functions..."
  31. result = CLOSCRIT()
  32. IF result # 0
  33.    ? "Close failed, result number: "+STR(result,4)
  34. ELSE
  35.    ? "Close successful."
  36. ENDIF
  37. QUIT
  38.