You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
289 B

  1. package gls
  2. var (
  3. symPool = &idPool{}
  4. )
  5. // ContextKey is a throwaway value you can use as a key to a ContextManager
  6. type ContextKey struct{ id uint }
  7. // GenSym will return a brand new, never-before-used ContextKey
  8. func GenSym() ContextKey {
  9. return ContextKey{id: symPool.Acquire()}
  10. }