1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
9 // defined in package runtime
11 // Semacquire waits until *s > 0 and then atomically decrements it.
12 // It is intended as a simple sleep primitive for use by the synchronization
13 // library and should not be used directly.
14 func runtime_Semacquire(s
*uint32)
16 // Semrelease atomically increments *s and notifies a waiting goroutine
17 // if one is blocked in Semacquire.
18 // It is intended as a simple wakeup primitive for use by the synchronization
19 // library and should not be used directly.
20 func runtime_Semrelease(s
*uint32)
22 // Approximation of notifyList in runtime/sema.go. Size and alignment must
24 type notifyList
struct {
32 // See runtime/sema.go for documentation.
33 func runtime_notifyListAdd(l
*notifyList
) uint32
35 // See runtime/sema.go for documentation.
36 func runtime_notifyListWait(l
*notifyList
, t
uint32)
38 // See runtime/sema.go for documentation.
39 func runtime_notifyListNotifyAll(l
*notifyList
)
41 // See runtime/sema.go for documentation.
42 func runtime_notifyListNotifyOne(l
*notifyList
)
44 // Ensure that sync and runtime agree on size of notifyList.
45 func runtime_notifyListCheck(size
uintptr)
48 runtime_notifyListCheck(unsafe
.Sizeof(n
))
51 // Active spinning runtime support.
52 // runtime_canSpin returns true is spinning makes sense at the moment.
53 func runtime_canSpin(i
int) bool
55 // runtime_doSpin does active spinning.