diff options
author | Russ Cox <rsc@golang.org> | 2009-10-15 17:46:53 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-10-15 17:46:53 -0700 |
commit | a86d7c2bd9196ad9c768a4cb52b5434d23f8fe84 (patch) | |
tree | b18dff11371da4606dfa47c3018e78f62f3b6564 /src/pkg/runtime/extern.go | |
parent | 96c3809cb09820dd80548f1940a35e442c93c65d (diff) | |
download | golang-a86d7c2bd9196ad9c768a4cb52b5434d23f8fe84.tar.gz |
publish semacquire and semrelease for use by sync.
more enforcing package boundaries
R=r
DELTA=46 (13 added, 15 deleted, 18 changed)
OCL=35806
CL=35806
Diffstat (limited to 'src/pkg/runtime/extern.go')
-rw-r--r-- | src/pkg/runtime/extern.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pkg/runtime/extern.go b/src/pkg/runtime/extern.go index 131767aef..70c6f434b 100644 --- a/src/pkg/runtime/extern.go +++ b/src/pkg/runtime/extern.go @@ -46,3 +46,14 @@ func GOMAXPROCS(n int) // Cgocalls returns the number of cgo calls made by the current process. func Cgocalls() int64 + +// Semacquire waits until *s > 0 and then atomically decrements it. +// It is intended as a simple sleep primitive for use by the synchronization +// library and should not be used directly. +func Semacquire(s *uint32) + +// Semrelease atomically increments *s and notifies a waiting goroutine +// if one is blocked in Semacquire. +// It is intended as a simple wakeup primitive for use by the synchronization +// library and should not be used directly. +func Semrelease(s *uint32) |