# HG changeset patch # User Francisco J Ballesteros # Date 1317751427 0 # Node ID cdc421aa99b2a65fb40571e86fa6d4342edbb500 # Parent e675e51ce089f6ce5f61ad08a90ab2381dd8ca50 thread: make Channel an implementation type. Declare it as an incomplete type. That way we can use Channel* as incomplete, needed by liberror. R=nix-dev, rminnich CC=nix-dev http://codereview.appspot.com/5150051 diff -r e675e51ce089 -r cdc421aa99b2 sys/include/thread.h --- a/sys/include/thread.h Tue Oct 04 18:02:48 2011 +0000 +++ b/sys/include/thread.h Tue Oct 04 18:03:47 2011 +0000 @@ -6,6 +6,7 @@ typedef struct Alt Alt; typedef struct Channel Channel; typedef struct Ref Ref; +#pragma incomplete Channel /* * Channel structure. S is the size of the buffer. For unbuffered channels @@ -20,18 +21,6 @@ Nqbits = (1 << Nqshift) * 2, }; -struct Channel { - int s; /* Size of the channel (may be zero) */ - uint f; /* Extraction point (insertion pt: (f+n) % s) */ - uint n; /* Number of values in the channel */ - int e; /* Element size */ - int freed; /* Set when channel is being deleted */ - volatile Alt **qentry; /* Receivers/senders waiting (malloc) */ - volatile int nentry; /* # of entries malloc-ed */ - volatile int closed; /* channel is closed */ - uchar v[1]; /* Array of s values in the channel */ -}; - /* Channel operations for alt: */ typedef enum { diff -r e675e51ce089 -r cdc421aa99b2 sys/src/libthread/threadimpl.h --- a/sys/src/libthread/threadimpl.h Tue Oct 04 18:02:48 2011 +0000 +++ b/sys/src/libthread/threadimpl.h Tue Oct 04 18:03:47 2011 +0000 @@ -26,6 +26,18 @@ typedef struct Execargs Execargs; typedef struct Proc Proc; +struct Channel { + int s; /* Size of the channel (may be zero) */ + uint f; /* Extraction point (insertion pt: (f+n) % s) */ + uint n; /* Number of values in the channel */ + int e; /* Element size */ + int freed; /* Set when channel is being deleted */ + volatile Alt **qentry; /* Receivers/senders waiting (malloc) */ + volatile int nentry; /* # of entries malloc-ed */ + volatile int closed; /* channel is closed */ + uchar v[1]; /* Array of s values in the channel */ +}; + /* must match list in sched.c */ typedef enum {