Cursor returns the current cursor value. Capture this before checking your condition, then pass it to Wait().
()
| 38 | // Cursor returns the current cursor value. |
| 39 | // Capture this before checking your condition, then pass it to Wait(). |
| 40 | func (t *Cond) Cursor() uint64 { |
| 41 | return t.cursor.Load() |
| 42 | } |
| 43 | |
| 44 | // Wait waits for a Tick() to occur after the given cursor value. |
| 45 | // Returns the new cursor value when awakened. |