oleiade / lane

Generic PriorityQueues, Queues, Stacks, and Deque data structures for Go
https://pkg.go.dev/github.com/oleiade/lane#pkg-types
MIT License
877 stars 76 forks source link

Make Lock/Unlock optional #21

Open HackerQacker opened 6 years ago

HackerQacker commented 6 years ago

Hello! I think that making Lock/Unlock optional would be vital, for instance, if someone will wrap and lock there (wrapper).

if pq.autoLock { pq.Lock() defer pq.Unlock() }