summaryrefslogtreecommitdiff
path: root/src/runtime/rt1_amd64_linux.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-01-26 17:37:05 -0800
committerRuss Cox <rsc@golang.org>2009-01-26 17:37:05 -0800
commit3b2ef42e707bf994b78bae3f56c1d703fe62c1e4 (patch)
tree716e6b85c74f50ceb20e1aa0bd630654b5c13e17 /src/runtime/rt1_amd64_linux.c
parent4bc3343d0db203003906c9a1fc8d0cdc43e1442d (diff)
downloadgolang-3b2ef42e707bf994b78bae3f56c1d703fe62c1e4.tar.gz
gc #0. mark and sweep collector.
R=r,gri DELTA=472 (423 added, 2 deleted, 47 changed) OCL=23522 CL=23541
Diffstat (limited to 'src/runtime/rt1_amd64_linux.c')
-rw-r--r--src/runtime/rt1_amd64_linux.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/rt1_amd64_linux.c b/src/runtime/rt1_amd64_linux.c
index 74032e4c1..c0c203805 100644
--- a/src/runtime/rt1_amd64_linux.c
+++ b/src/runtime/rt1_amd64_linux.c
@@ -306,6 +306,8 @@ lock(Lock *l)
{
uint32 v;
+ m->locks++;
+
again:
v = l->key;
if((v&1) == 0){
@@ -349,6 +351,8 @@ unlock(Lock *l)
{
uint32 v;
+ m->locks--;
+
// Atomically get value and clear lock bit.
again:
v = l->key;