1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-09 05:01:02 -08:00
emacs/mps/code/lockcov.c
Richard Brooksby c0bb4cd3cd Removing hopenames from the master sources.
This change will be integrated but ignored (-ay) to the gg-epcore/union sources, so that they retain HopeNames.

Copied from Perforce
 Change: 24911
 ServerID: perforce.ravenbrook.com
2001-12-07 13:19:25 +00:00

50 lines
993 B
C

/* impl.c.lockcov: LOCK COVERAGE TEST
*
* $Id$
* Copyright (c) 2001 Ravenbrook Limited.
*/
#include "mpm.h"
#include "testlib.h"
#include <stdlib.h> /* for malloc & free */
int main(void)
{
Lock a = malloc(LockSize());
Lock b = malloc(LockSize());
Insist(a != NULL);
Insist(b != NULL);
LockInit(a);
LockInit(b);
LockClaimGlobal();
LockClaim(a);
LockClaimRecursive(b);
LockClaimGlobalRecursive();
LockReleaseGlobal();
LockClaimGlobal();
LockReleaseMPM(a);
LockClaimGlobalRecursive();
LockReleaseGlobal();
LockClaimRecursive(b);
LockFinish(a);
LockReleaseRecursive(b);
LockReleaseRecursive(b);
LockFinish(b);
LockInit(a);
LockClaim(a);
LockClaimRecursive(a);
LockReleaseGlobalRecursive();
LockReleaseRecursive(a);
LockReleaseMPM(a);
LockFinish(a);
LockReleaseGlobalRecursive();
free(a);
free(b);
fflush(stdout); /* synchronize */
fprintf(stderr, "\nConclusion: Failed to find any defects.\n");
return 0;
}