# HG changeset patch # User Francisco J Ballesteros # Date 1317714257 -7200 # Node ID 61c22f46a2e7a13d74f93382fd3b473d35646e63 # Parent cdc421aa99b2a65fb40571e86fa6d4342edbb500 undo CL 5150051 / cdc421aa99b2 thread: some programs declare arrays of Channels, which requires the type to be public. ««« original CL description 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 »»» R=nix-dev CC=nix-dev http://codereview.appspot.com/5166053 diff -r cdc421aa99b2 -r 61c22f46a2e7 sys/include/thread.h --- a/sys/include/thread.h Tue Oct 04 18:03:47 2011 +0000 +++ b/sys/include/thread.h Tue Oct 04 09:44:17 2011 +0200 @@ -6,7 +6,6 @@ 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 @@ -21,6 +20,18 @@ 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 cdc421aa99b2 -r 61c22f46a2e7 sys/src/libthread/threadimpl.h --- a/sys/src/libthread/threadimpl.h Tue Oct 04 18:03:47 2011 +0000 +++ b/sys/src/libthread/threadimpl.h Tue Oct 04 09:44:17 2011 +0200 @@ -26,18 +26,6 @@ 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 {