File tree 1 file changed +3
-9
lines changed
1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -112,10 +112,9 @@ impl ChannelSync {
112
112
/// Generate a syncer out of a ChannelSync.
113
113
#[ allow( dead_code) ]
114
114
pub fn get_channel_syncer ( ) -> Vec < Arc < dyn ForkSync > > {
115
- let command_queue = COMMAND_QUEUE . init_once ( ( ) ) . unwrap ( ) ;
116
- let ( cq_send, cq_recv) = channel:: unbounded_from ( command_queue) ;
117
- let reply_queues = REPLY_QUEUES . each_ref ( ) . map ( |m| {
118
- channel:: unbounded_from ( m. init_once ( ( ) ) . unwrap ( ) )
115
+ let ( cq_send, cq_recv) = channel:: unbounded ( ) ;
116
+ let reply_queues = [ ( ) ; NUM_PHIL ] . each_ref ( ) . map ( |( ) | {
117
+ channel:: unbounded ( )
119
118
} ) ;
120
119
let syncer = reply_queues. into_iter ( ) . map ( |rqueue| {
121
120
let item = Box :: new ( ChannelSync :: new ( cq_send. clone ( ) , rqueue) )
@@ -165,9 +164,4 @@ impl ForkSync for ChannelSync {
165
164
kobj_define ! {
166
165
static CHANNEL_STACK : ThreadStack <2054 >;
167
166
static CHANNEL_THREAD : StaticThread ;
168
-
169
- // For communicating using Queue, there is one to the main thread (the manager), and one back
170
- // to each philosopher.
171
- static COMMAND_QUEUE : StaticQueue ;
172
- static REPLY_QUEUES : [ StaticQueue ; NUM_PHIL ] ;
173
167
}
You can’t perform that action at this time.
0 commit comments