diff options
| author | Keith Randall <khr@golang.org> | 2014-08-24 12:31:03 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2014-08-24 12:31:03 +0400 |
| commit | 9a1e142bbc3209f8899a729ec857a1c8838bf9f4 (patch) | |
| tree | d490b16e05e6d80d05d295d4379f944fbf7317a9 /src/pkg/runtime/runtime.h | |
| parent | 7f223e3b3ba732c287db5a57b5091784baa9b86f (diff) | |
| download | go-9a1e142bbc3209f8899a729ec857a1c8838bf9f4.tar.xz | |
runtime: convert channel operations to Go, part 1 (chansend1).
LGTM=dvyukov
R=dvyukov, khr
CC=golang-codereviews
https://golang.org/cl/127460044
Diffstat (limited to 'src/pkg/runtime/runtime.h')
| -rw-r--r-- | src/pkg/runtime/runtime.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h index dcce369a5c..f12e50cbfb 100644 --- a/src/pkg/runtime/runtime.h +++ b/src/pkg/runtime/runtime.h @@ -63,6 +63,7 @@ typedef uint8 byte; typedef struct Func Func; typedef struct G G; typedef struct Gobuf Gobuf; +typedef struct SudoG SudoG; typedef struct Lock Lock; typedef struct M M; typedef struct P P; @@ -217,6 +218,18 @@ struct Gobuf uintreg ret; uintptr lr; }; +// Known to compiler. +// Changes here must also be made in src/cmd/gc/select.c's selecttype. +struct SudoG +{ + G* g; + uint32* selectdone; + SudoG* link; + byte* elem; // data element + int64 releasetime; + int32 nrelease; // -1 for acquire + SudoG* waitlink; // G.waiting list +}; struct GCStats { // the struct must consist of only uint64's, @@ -285,6 +298,7 @@ struct G uintptr sigpc; uintptr gopc; // pc of go statement that created this goroutine uintptr racectx; + SudoG *waiting; // sudog structures this G is waiting on (that have a valid elem ptr) uintptr end[]; }; @@ -884,7 +898,6 @@ MCache* runtime·allocmcache(void); void runtime·freemcache(MCache*); void runtime·mallocinit(void); void runtime·gcinit(void); -void runtime·chaninit(void); void* runtime·mallocgc(uintptr size, Type* typ, uint32 flag); void runtime·runpanic(Panic*); uintptr runtime·getcallersp(void*); |
