An attempt at a channel select statement. Seems conceptually sound, but there are strange crashes.

The crashes seem to be occurring in and around the new Select() function, which makes heavy use of objects typed as one of their protocols. Is that a fragile area?

In order to work with Select, channels implement a Selectable protocol. Selectable defines the interface by which the Select function registers another channel, through which it waits for a notification.
This special channel is a singleton which accepts a single write before automatically closing itself. This makes it reasonably immune to contention, which also enables it to carry a data payload across threads on behalf of the Selectable channel that used it.

The switch case that follows the Select call is unfortunately unwieldy. For some reason an object reference is not valid as the control expression for a switch statement. The pattern expression for each case then becomes much more complex, requiring condition (where) clauses.
A first successful cut at a Select statement.

The Select() function works properly with concrete typed arguments, but fails mysteriously with Protocol-as-Type arguments.
This, even though they call the same methods and have the same logic.
Minor corrections for things that slipped by after the Select() work.
Brought chan-directional up to SelectableChannel conformance.
First stab at a Chan that doesn't use pthread_mutex.
GCD buffered channels were made the official buffered channels
Moved the pthreads implementation to a separate file for the purpose of future benchmarking.
An unbuffered chan implementation for GCD. Still has a race condition.

The solution is to *always* resume one queue upon suspending the other.
Resuming one queue is not relevant to the other , since if both queues are empty they should both be active.

The reason the buffered version did not have this problem is that the number of situations where a queue get suspended is so much smaller.
The suspend/resume rule applies to all cases, however, and should be enforced.
Got rid of the (silly?) Signal class in favor of just closures. Signal is not a typealias for () -> ().
Completed the Chan implementations using Grand Central Dispatch (dispatch_sync for the win).

Along the way also improved the type interface for the channel-select constructs. Lots of fragility there in beta 6.
A little benchmarking code. The pthread-mutex is lots faster than the synchronous block dispatch stuff.

Included a similar benchmark in go. *that* is fast.
Update the typed Select() function for the renamed interfaces in select-types
The Merge() and Select() function appear to be fragile as to their degree of Genericity. Select<T> works, Select<C: SelectableChannel> does not.

Different versions saved; must find a good test case.
The buffered channel with capacity greater than 1 is back. So is the Queue.

(but the Queue may remain for much longer.)
Cleanup.
Merge back