1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-25 07:40:40 -07:00
emacs/mps/code/lockcov.c
Richard Brooksby d0ccf8fa9a Adding hopenames back into the master sources, so that they can be included in the union sources along with the id keywords.
This was achieved by partially undoing changelist 24817, including an accidental corruption of eventgen.pl.

Copied from Perforce
 Change: 24877
 ServerID: perforce.ravenbrook.com
2001-12-06 18:14:02 +00:00

51 lines
1 KiB
C

/* impl.c.lockcov: LOCK COVERAGE TEST
*
* $Id$
* $HopeName: MMsrc!lockcov.c(trunk.5) $
* 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;
}