+func (mc *testingSubmgrControl) get_registry_next_subid(t *testing.T) uint32 {
+ mc.c.registry.mutex.Lock()
+ defer mc.c.registry.mutex.Unlock()
+ return mc.c.registry.subIds[0]
+}
+
+func (mc *testingSubmgrControl) wait_registry_next_subid_change(t *testing.T, origSubId uint32, secs int) (uint32, bool) {
+ i := 1
+ for ; i <= secs*2; i++ {
+ mc.c.registry.mutex.Lock()
+ currSubId := mc.c.registry.subIds[0]
+ mc.c.registry.mutex.Unlock()
+ if currSubId != origSubId {
+ return currSubId, true
+ }
+ time.Sleep(500 * time.Millisecond)
+ }
+ mc.TestError(t, "(submgr) no subId change within %d secs", secs)
+ return 0, false
+}
+