We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Now the add method code is like this:
func (l *List[Key, Value]) Add(searchStart *ListElement[Key, Value], hash uintptr, key Key, value Value) (element *ListElement[Key, Value], existed bool, inserted bool) { left, found, right := l.search(searchStart, hash, key) if found != nil { // existing item found return found, true, false } element = &ListElement[Key, Value]{ key: key, keyHash: hash, } element.value.Store(&value) return element, false, l.insertAt(element, left, right) }
The problem exists :
element.value.Store(&value) return element, false, l.insertAt(element, left, right)
This is not a atomic operation.The proposal atomicOp may solve this if atomicpointer with other metainfo is supported.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Now the add method code is like this:
The problem exists :
This is not a atomic operation.The proposal atomicOp may solve this if atomicpointer with other metainfo is supported.
The text was updated successfully, but these errors were encountered: