From c007ce824d9a4fccb148f9204e04c23ed2984b71 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 8 Sep 2014 00:08:51 -0400 Subject: build: move package sources from src/pkg to src Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg. --- src/pkg/runtime/lfstack.c | 87 ----------------------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 src/pkg/runtime/lfstack.c (limited to 'src/pkg/runtime/lfstack.c') diff --git a/src/pkg/runtime/lfstack.c b/src/pkg/runtime/lfstack.c deleted file mode 100644 index 57e0af2829..0000000000 --- a/src/pkg/runtime/lfstack.c +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Lock-free stack. -// The following code runs only on g0 stack. - -#include "runtime.h" -#include "arch_GOARCH.h" - -#ifdef _64BIT -// Amd64 uses 48-bit virtual addresses, 47-th bit is used as kernel/user flag. -// So we use 17msb of pointers as ABA counter. -# define PTR_BITS 47 -#else -# define PTR_BITS 32 -#endif -#define PTR_MASK ((1ull<pushcnt++; - new = (uint64)(uintptr)node|(((uint64)node->pushcnt&CNT_MASK)<next = (LFNode*)(uintptr)(old&PTR_MASK); - if(runtime·cas64(head, old, new)) - break; - } -} - -LFNode* -runtime·lfstackpop(uint64 *head) -{ - LFNode *node, *node2; - uint64 old, new; - - for(;;) { - old = runtime·atomicload64(head); - if(old == 0) - return nil; - node = (LFNode*)(uintptr)(old&PTR_MASK); - node2 = runtime·atomicloadp(&node->next); - new = 0; - if(node2 != nil) - new = (uint64)(uintptr)node2|(((uint64)node2->pushcnt&CNT_MASK)<m->ptrarg[0], g->m->ptrarg[1]); - g->m->ptrarg[0] = nil; - g->m->ptrarg[1] = nil; -} - -void -runtime·lfstackpop_m(void) -{ - g->m->ptrarg[0] = runtime·lfstackpop(g->m->ptrarg[0]); -} -- cgit v1.3