aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/runtime.h
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2013-02-23 08:48:02 +0400
committerDmitriy Vyukov <dvyukov@google.com>2013-02-23 08:48:02 +0400
commit353ce60f6e8e5898efec62945fbafd33bc28a37b (patch)
tree2b170231608cd192911c2f58c616ce4afe01004b /src/pkg/runtime/runtime.h
parent1d7faf91dfe6aaa5f43b74b19bc014937ea92337 (diff)
downloadgo-353ce60f6e8e5898efec62945fbafd33bc28a37b.tar.xz
runtime: implement local work queues (in preparation for new scheduler)
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7402047
Diffstat (limited to 'src/pkg/runtime/runtime.h')
-rw-r--r--src/pkg/runtime/runtime.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h
index 24591995c8..61e33eb95e 100644
--- a/src/pkg/runtime/runtime.h
+++ b/src/pkg/runtime/runtime.h
@@ -52,6 +52,7 @@ typedef struct G G;
typedef struct Gobuf Gobuf;
typedef union Lock Lock;
typedef struct M M;
+typedef struct P P;
typedef struct Mem Mem;
typedef union Note Note;
typedef struct Slice Slice;
@@ -312,6 +313,17 @@ struct M
uintptr end[];
};
+struct P
+{
+ Lock;
+
+ // Queue of runnable goroutines.
+ G** runq;
+ int32 runqhead;
+ int32 runqtail;
+ int32 runqsize;
+};
+
// The m->locked word holds a single bit saying whether
// external calls to LockOSThread are in effect, and then a counter
// of the internal nesting depth of lockOSThread / unlockOSThread.