From d0ae2f62ae451891c681c995f8cf40a5adc8e4ad Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 21 Oct 2014 22:35:30 +0100 Subject: [PATCH] Rename lockreleasempm to lockrelease. this name was changed because of a clash with a symbol in scriptworks, and that's no longer a concern. see . if we get symbol name clashes in future, we can try the .name.single strategy, or maybe objcopy --prefix. Copied from Perforce Change: 187322 ServerID: perforce.ravenbrook.com --- mps/code/global.c | 4 ++-- mps/code/lock.h | 20 ++++++++++---------- mps/code/lockan.c | 8 ++++---- mps/code/lockcov.c | 4 ++-- mps/code/lockix.c | 10 +++++----- mps/code/lockli.c | 10 +++++----- mps/code/lockut.c | 2 +- mps/code/lockw3.c | 8 ++++---- mps/code/testthr.h | 2 +- mps/design/lock.txt | 2 +- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/mps/code/global.c b/mps/code/global.c index 7445593201c..df0095d3195 100644 --- a/mps/code/global.c +++ b/mps/code/global.c @@ -438,7 +438,7 @@ void GlobalsPrepareToDestroy(Globals arenaGlobals) arenaGlobals->defaultChain = NULL; ChainDestroy(defaultChain); - LockReleaseMPM(arenaGlobals->lock); + LockRelease(arenaGlobals->lock); /* Theoretically, another thread could grab the lock here, but it's */ /* not worth worrying about, since an attempt after the lock has been */ /* destroyed would lead to a crash just the same. */ @@ -591,7 +591,7 @@ void ArenaLeaveLock(Arena arena, Bool recursive) if(recursive) { LockReleaseRecursive(lock); } else { - LockReleaseMPM(lock); + LockRelease(lock); } return; } diff --git a/mps/code/lock.h b/mps/code/lock.h index 4fcd591a0f2..4658fc646ed 100644 --- a/mps/code/lock.h +++ b/mps/code/lock.h @@ -1,7 +1,7 @@ /* lock.h: RECURSIVE LOCKS * * $Id$ - * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. + * Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license. * * .description: [@@@@ Should be combined with ] * This defines the type Lock, which supports simple recursive @@ -32,10 +32,10 @@ * There is a limit on the number of recursive claims which * depends on the implementation. See issue.lock-claim-limit. * - * LockClaim and LockReleaseMPM are the same as the Recursive versions, + * LockClaim and LockRelease are the same as the Recursive versions, * except that LockClaim may only be used by a thread that doesn't - * already own the lock, and LockReleaseMPM may only be used to release - * a lock with one claim. LockClaim and LockReleaseMPM if used, must + * already own the lock, and LockRelease may only be used to release + * a lock with one claim. LockClaim and LockRelease if used, must * be used symmetrically in pairs. * * There are two intended uses. Here is an example: @@ -48,7 +48,7 @@ * ;; lock owned by this thread. * ;; Cannot call binaryUse() at this point. * ;; only one thread at a time may be at this point. - * LockReleaseMPM(&lockStruct); + * LockRelease(&lockStruct); * ;; lock not owned by this thread. * } * @@ -129,20 +129,20 @@ extern void LockReleaseRecursive(Lock lock); * This may only be used when the lock is not already owned by * the calling thread. * When used it behaves like LockClaimRecursive, but must be - * matched by a call to LockReleaseMPM. + * matched by a call to LockRelease. */ extern void LockClaim(Lock lock); -/* LockReleaseMPM +/* LockRelease * * This must only be used to release a Lock symmetrically * with LockClaim. It therefore should only be called with * a single claim. */ -extern void LockReleaseMPM(Lock lock); +extern void LockRelease(Lock lock); /* LockCheck -- Validation */ @@ -204,7 +204,7 @@ extern void LockReleaseGlobal(void); #define LockClaimRecursive(lock) UNUSED(lock) #define LockReleaseRecursive(lock) UNUSED(lock) #define LockClaim(lock) UNUSED(lock) -#define LockReleaseMPM(lock) UNUSED(lock) +#define LockRelease(lock) UNUSED(lock) #define LockCheck(lock) ((void)lock, TRUE) #define LockClaimGlobalRecursive() #define LockReleaseGlobalRecursive() @@ -220,7 +220,7 @@ extern void LockReleaseGlobal(void); /* C. COPYRIGHT AND LICENSE * - * Copyright (C) 2001-2002 Ravenbrook Limited . + * Copyright (C) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/lockan.c b/mps/code/lockan.c index f720e22755d..fe5082a6ebf 100644 --- a/mps/code/lockan.c +++ b/mps/code/lockan.c @@ -1,7 +1,7 @@ /* lockan.c: ANSI RECURSIVE LOCKS * * $Id$ - * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. + * Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license. * * .purpose: This is a trivial implementation of recursive locks * that assumes we are not running in a multi-threaded environment. @@ -58,7 +58,7 @@ void (LockClaim)(Lock lock) lock->claims = 1; } -void (LockReleaseMPM)(Lock lock) +void (LockRelease)(Lock lock) { AVERT(Lock, lock); AVER(lock->claims == 1); @@ -118,13 +118,13 @@ void (LockClaimGlobal)(void) void (LockReleaseGlobal)(void) { - LockReleaseMPM(globalLock); + LockRelease(globalLock); } /* C. COPYRIGHT AND LICENSE * - * Copyright (C) 2001-2002 Ravenbrook Limited . + * Copyright (C) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/lockcov.c b/mps/code/lockcov.c index 75ded6f202a..84866046d82 100644 --- a/mps/code/lockcov.c +++ b/mps/code/lockcov.c @@ -46,7 +46,7 @@ int main(int argc, char *argv[]) LockClaimGlobalRecursive(); LockReleaseGlobal(); LockClaimGlobal(); - LockReleaseMPM(a); + LockRelease(a); LockClaimGlobalRecursive(); LockReleaseGlobal(); LockClaimRecursive(b); @@ -59,7 +59,7 @@ int main(int argc, char *argv[]) LockClaimRecursive(a); LockReleaseGlobalRecursive(); LockReleaseRecursive(a); - LockReleaseMPM(a); + LockRelease(a); LockFinish(a); LockReleaseGlobalRecursive(); diff --git a/mps/code/lockix.c b/mps/code/lockix.c index 2afd294246e..c982bf0cb17 100644 --- a/mps/code/lockix.c +++ b/mps/code/lockix.c @@ -1,7 +1,7 @@ /* lockix.c: RECURSIVE LOCKS FOR POSIX SYSTEMS * * $Id$ - * Copyright (c) 2001,2007 Ravenbrook Limited. See end of file for license. + * Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license. * * .posix: The implementation uses a POSIX interface, and should be reusable * for many Unix-like operating systems. @@ -131,9 +131,9 @@ void (LockClaim)(Lock lock) } -/* LockReleaseMPM -- release a lock (non-recursive) */ +/* LockRelease -- release a lock (non-recursive) */ -void (LockReleaseMPM)(Lock lock) +void (LockRelease)(Lock lock) { int res; @@ -239,13 +239,13 @@ void (LockClaimGlobal)(void) void (LockReleaseGlobal)(void) { - LockReleaseMPM(globalLock); + LockRelease(globalLock); } /* C. COPYRIGHT AND LICENSE * - * Copyright (C) 2001-2002 Ravenbrook Limited . + * Copyright (C) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/lockli.c b/mps/code/lockli.c index 89e8f4f0653..0dc98fb8a25 100644 --- a/mps/code/lockli.c +++ b/mps/code/lockli.c @@ -1,7 +1,7 @@ /* lockli.c: RECURSIVE LOCKS FOR POSIX SYSTEMS * * $Id$ - * Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license. + * Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license. * * .linux: This implementation currently just supports LinuxThreads * (platform MPS_OS_LI), Single Unix i/f. @@ -145,9 +145,9 @@ void (LockClaim)(Lock lock) } -/* LockReleaseMPM -- release a lock (non-recursive) */ +/* LockRelease -- release a lock (non-recursive) */ -void (LockReleaseMPM)(Lock lock) +void (LockRelease)(Lock lock) { int res; @@ -253,13 +253,13 @@ void (LockClaimGlobal)(void) void (LockReleaseGlobal)(void) { - LockReleaseMPM(globalLock); + LockRelease(globalLock); } /* C. COPYRIGHT AND LICENSE * - * Copyright (C) 2001-2013 Ravenbrook Limited . + * Copyright (C) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/lockut.c b/mps/code/lockut.c index e93bdea6815..a6e592988f1 100644 --- a/mps/code/lockut.c +++ b/mps/code/lockut.c @@ -49,7 +49,7 @@ static void inc(unsigned long i) tmp = shared; shared = tmp+1; i--; - LockReleaseMPM(lock); + LockRelease(lock); } } diff --git a/mps/code/lockw3.c b/mps/code/lockw3.c index 2fdc2800032..53da970aed2 100644 --- a/mps/code/lockw3.c +++ b/mps/code/lockw3.c @@ -1,7 +1,7 @@ /* lockw3.c: RECURSIVE LOCKS IN WIN32 * * $Id$ - * Copyright (c) 2001 Ravenbrook Limited. See end of file for license. + * Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license. * * .design: These are implemented using critical sections. * See the section titled "Synchronization functions" in the Groups @@ -79,7 +79,7 @@ void (LockClaim)(Lock lock) lock->claims = 1; } -void (LockReleaseMPM)(Lock lock) +void (LockRelease)(Lock lock) { AVERT(Lock, lock); AVER(lock->claims == 1); /* The lock should only be held once */ @@ -152,13 +152,13 @@ void (LockClaimGlobal)(void) void (LockReleaseGlobal)(void) { AVER(globalLockInit); - LockReleaseMPM(globalLock); + LockRelease(globalLock); } /* C. COPYRIGHT AND LICENSE * - * Copyright (C) 2001-2002 Ravenbrook Limited . + * Copyright (C) 2001-2014 Ravenbrook Limited . * All rights reserved. This is an open source license. Contact * Ravenbrook for commercial licensing options. * diff --git a/mps/code/testthr.h b/mps/code/testthr.h index 341f4f407b5..75602bcc56f 100644 --- a/mps/code/testthr.h +++ b/mps/code/testthr.h @@ -6,7 +6,7 @@ * .purpose: Simple interface to threads that makes it possible to * write test cases that are portable between Windows (using the * implementation in testthrw3.c) and Unix (using the implementation - * in testthrix.c). + * in testthrix.c). See . */ #ifndef testthr_h diff --git a/mps/design/lock.txt b/mps/design/lock.txt index cd472b1a872..8f08c9f8d8d 100644 --- a/mps/design/lock.txt +++ b/mps/design/lock.txt @@ -116,7 +116,7 @@ Before finalisation the lock must not beowned by any thread. Claims ownership of a lock that was previously not held by current thread. -``void LockReleaseMPM(Lock lock)`` +``void LockRelease(Lock lock)`` Releases ownership of a lock that is currently owned.