@@ -182,14 +182,16 @@ impl ThreadTests {
182
182
} ) ;
183
183
184
184
// Calculate a size to show.
185
- printkln ! ( "worker size: {} bytes" ,
186
- work_size(
187
- Self :: ping_pong_worker_async(
188
- result. clone( ) ,
189
- 0 ,
190
- result. sems[ 0 ] . clone( ) ,
191
- result. back_sems[ 0 ] . clone( ) ,
192
- 6 ) ) ) ;
185
+ printkln ! (
186
+ "worker size: {} bytes" ,
187
+ work_size( Self :: ping_pong_worker_async(
188
+ result. clone( ) ,
189
+ 0 ,
190
+ result. sems[ 0 ] . clone( ) ,
191
+ result. back_sems[ 0 ] . clone( ) ,
192
+ 6
193
+ ) )
194
+ ) ;
193
195
194
196
result
195
197
}
@@ -308,7 +310,13 @@ impl ThreadTests {
308
310
}
309
311
310
312
Command :: SemPingPong ( count) => {
311
- this. ping_pong_worker ( id, & this. sems [ id] , & this. back_sems [ id] , count, & mut total) ;
313
+ this. ping_pong_worker (
314
+ id,
315
+ & this. sems [ id] ,
316
+ & this. back_sems [ id] ,
317
+ count,
318
+ & mut total,
319
+ ) ;
312
320
}
313
321
314
322
Command :: SemOnePingPong ( count) => {
@@ -379,10 +387,7 @@ impl ThreadTests {
379
387
) ;
380
388
if id == 0 {
381
389
spawn (
382
- Self :: ping_pong_replier_async (
383
- this. clone ( ) ,
384
- count,
385
- ) ,
390
+ Self :: ping_pong_replier_async ( this. clone ( ) , count) ,
386
391
& this. workq ,
387
392
c"giver" ,
388
393
) ;
@@ -407,11 +412,7 @@ impl ThreadTests {
407
412
) ;
408
413
}
409
414
spawn (
410
- Self :: one_ping_pong_replier_async (
411
- this. clone ( ) ,
412
- nthread,
413
- count,
414
- ) ,
415
+ Self :: one_ping_pong_replier_async ( this. clone ( ) , nthread, count) ,
415
416
& this. workq ,
416
417
c"giver" ,
417
418
) ;
@@ -506,7 +507,14 @@ impl ThreadTests {
506
507
}
507
508
508
509
/// Worker side of the ping pong sem, takes the 'sem' and gives to the back_sem.
509
- fn ping_pong_worker ( & self , id : usize , sem : & Semaphore , back_sem : & Semaphore , count : usize , total : & mut usize ) {
510
+ fn ping_pong_worker (
511
+ & self ,
512
+ id : usize ,
513
+ sem : & Semaphore ,
514
+ back_sem : & Semaphore ,
515
+ count : usize ,
516
+ total : & mut usize ,
517
+ ) {
510
518
for i in 0 ..count {
511
519
if false {
512
520
if let Ok ( _) = sem. take ( NoWait ) {
0 commit comments