aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime.h
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2008-07-14 14:33:39 -0700
committerKen Thompson <ken@golang.org>2008-07-14 14:33:39 -0700
commit526200345cd6b1e1449f7adb62f05410ff01a44a (patch)
tree86fb2f1fb7c7a70a32d6e53bea5b489e02127a8d /src/runtime/runtime.h
parentf7e2bb55ae4638be8027d5b80b0e50795782c52d (diff)
downloadgo-526200345cd6b1e1449f7adb62f05410ff01a44a.tar.xz
synch chan
SVN=127055
Diffstat (limited to 'src/runtime/runtime.h')
-rw-r--r--src/runtime/runtime.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h
index 4273f16eac..0b2e8ed975 100644
--- a/src/runtime/runtime.h
+++ b/src/runtime/runtime.h
@@ -42,6 +42,7 @@ typedef struct G G;
typedef struct M M;
typedef struct Stktop Stktop;
typedef struct Alg Alg;
+typedef struct WaitQ WaitQ;
/*
* per cpu declaration
@@ -57,6 +58,7 @@ enum
// G status
Gidle,
Grunnable,
+ Gwaiting,
Gdead,
};
enum
@@ -104,10 +106,12 @@ struct G
byte* stackguard; // must not move
byte* stackbase; // must not move
Gobuf sched;
- G* link;
+ G* alllink; // on allq
+ G* qlink; // on wait q
int32 status;
int32 pri;
int32 goid;
+ byte elem[8]; // transfer element for chan
};
struct M
{
@@ -121,7 +125,12 @@ struct M
int32 siz1;
int32 siz2;
};
-struct Stktop
+struct WaitQ
+{
+ G* first;
+ G* last;
+};
+struct Stktop
{
uint8* oldbase;
uint8* oldsp;
@@ -166,6 +175,8 @@ int32 findnull(int8*);
void dump(byte*, int32);
int32 runetochar(byte*, int32);
int32 chartorune(uint32*, byte*);
+G* dequeue(WaitQ*);
+void enqueue(WaitQ*, G*);
/*
* very low level c-called