]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/runtime/lfstack.go
[dev.garbage] all: merge dev.cc (493ad916c3b1) into dev.garbage
[gostls13.git] / src / runtime / lfstack.go
index 8a36a67b35706d170df6229cecf4e7562d7a4fda..fd3325972a855fb4bd965765db316ce53f615c7a 100644 (file)
@@ -18,7 +18,7 @@ func lfstackpush(head *uint64, node *lfnode) {
        }
        for {
                old := atomicload64(head)
-               node.next, _ = lfstackUnpack(old)
+               node.next = old
                if cas64(head, old, new) {
                        break
                }
@@ -32,12 +32,8 @@ func lfstackpop(head *uint64) unsafe.Pointer {
                        return nil
                }
                node, _ := lfstackUnpack(old)
-               node2 := (*lfnode)(atomicloadp(unsafe.Pointer(&node.next)))
-               new := uint64(0)
-               if node2 != nil {
-                       new = lfstackPack(node2, node2.pushcnt)
-               }
-               if cas64(head, old, new) {
+               next := atomicload64(&node.next)
+               if cas64(head, old, next) {
                        return unsafe.Pointer(node)
                }
        }