aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/sync/export_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/sync/export_test.go')
-rw-r--r--libgo/go/sync/export_test.go42
1 files changed, 42 insertions, 0 deletions
diff --git a/libgo/go/sync/export_test.go b/libgo/go/sync/export_test.go
index 669076e..10d3599 100644
--- a/libgo/go/sync/export_test.go
+++ b/libgo/go/sync/export_test.go
@@ -9,3 +9,45 @@ var Runtime_Semacquire = runtime_Semacquire
var Runtime_Semrelease = runtime_Semrelease
var Runtime_procPin = runtime_procPin
var Runtime_procUnpin = runtime_procUnpin
+
+// poolDequeue testing.
+type PoolDequeue interface {
+ PushHead(val interface{}) bool
+ PopHead() (interface{}, bool)
+ PopTail() (interface{}, bool)
+}
+
+func NewPoolDequeue(n int) PoolDequeue {
+ return &poolDequeue{
+ vals: make([]eface, n),
+ }
+}
+
+func (d *poolDequeue) PushHead(val interface{}) bool {
+ return d.pushHead(val)
+}
+
+func (d *poolDequeue) PopHead() (interface{}, bool) {
+ return d.popHead()
+}
+
+func (d *poolDequeue) PopTail() (interface{}, bool) {
+ return d.popTail()
+}
+
+func NewPoolChain() PoolDequeue {
+ return new(poolChain)
+}
+
+func (c *poolChain) PushHead(val interface{}) bool {
+ c.pushHead(val)
+ return true
+}
+
+func (c *poolChain) PopHead() (interface{}, bool) {
+ return c.popHead()
+}
+
+func (c *poolChain) PopTail() (interface{}, bool) {
+ return c.popTail()
+}