From 2a4dcfffc9d0618dd63b04db50816d82e4db5dc7 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 22 May 2009 22:42:12 -0700 Subject: simplifying grammar: delete LBASETYPE and LACONST R=ken OCL=29300 CL=29302 --- src/lib/sync/mutex.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/lib/sync') diff --git a/src/lib/sync/mutex.go b/src/lib/sync/mutex.go index 5a6311a837..e485867802 100644 --- a/src/lib/sync/mutex.go +++ b/src/lib/sync/mutex.go @@ -2,19 +2,19 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// The sync package provides basic synchronization primitives -// such as mutual exclusion locks. These are intended for use -// by low-level library routines. Higher-level synchronization -// is better done via channels and communication. +/* + The sync /* package * / provides basic sync primitives. + // Such as mutual exclusion locks. +*/ package sync func cas(val *int32, old, new int32) bool func semacquire(*int32) func semrelease(*int32) -// A Mutex is a mutual exclusion lock. -// Mutexes can be created as part of other structures; -// the zero value for a Mutex is an unlocked mutex. + // A Mutex is a mutual exclusion lock. + // Mutexes can be created as part of other structures; + // the zero value for a Mutex is an unlocked mutex. type Mutex struct { key int32; sema int32; @@ -30,9 +30,11 @@ func xadd(val *int32, delta int32) (new int32) { panic("unreached") } -// Lock locks m. -// If the lock is already in use, the calling goroutine -// blocks until the mutex is available. +/* + * Lock locks m. + * If the lock is already in use, the calling goroutine + * blocks until the mutex is available. + */ func (m *Mutex) Lock() { if xadd(&m.key, 1) == 1 { // changed from 0 to 1; we hold lock -- cgit v1.3