aboutsummaryrefslogtreecommitdiff
path: root/src/lib/sync
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-05-22 22:42:12 -0700
committerRuss Cox <rsc@golang.org>2009-05-22 22:42:12 -0700
commit2a4dcfffc9d0618dd63b04db50816d82e4db5dc7 (patch)
tree663f9c896bbee9961732b93a4b987cebff4f5199 /src/lib/sync
parentb112d42ad60551a075d0bf4c06667f11e7aa976d (diff)
downloadgo-2a4dcfffc9d0618dd63b04db50816d82e4db5dc7.tar.xz
simplifying grammar: delete LBASETYPE and LACONST
R=ken OCL=29300 CL=29302
Diffstat (limited to 'src/lib/sync')
-rw-r--r--src/lib/sync/mutex.go22
1 files changed, 12 insertions, 10 deletions
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