Changeset a35b458 in mainline for kernel/test/synch/semaphore1.c


Ignore:
Timestamp:
2018-03-02T20:10:49Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/synch/semaphore1.c

    r3061bc1 ra35b458  
    4949{
    5050        thread_detach(THREAD);
    51        
     51
    5252        waitq_sleep(&can_start);
    53        
     53
    5454        semaphore_down(&sem);
    5555        atomic_inc(&items_produced);
     
    6161{
    6262        thread_detach(THREAD);
    63        
     63
    6464        waitq_sleep(&can_start);
    65        
     65
    6666        semaphore_down(&sem);
    6767        atomic_inc(&items_consumed);
     
    7575        atomic_count_t consumers;
    7676        atomic_count_t producers;
    77        
     77
    7878        waitq_initialize(&can_start);
    7979        semaphore_initialize(&sem, AT_ONCE);
    80        
     80
    8181        for (i = 1; i <= 3; i++) {
    8282                thread_t *thrd;
    83                
     83
    8484                atomic_set(&items_produced, 0);
    8585                atomic_set(&items_consumed, 0);
    86                
     86
    8787                consumers = i * CONSUMERS;
    8888                producers = (4 - i) * PRODUCERS;
    89                
     89
    9090                TPRINTF("Creating %" PRIua " consumers and %" PRIua " producers...",
    9191                    consumers, producers);
    92                
     92
    9393                for (j = 0; j < (CONSUMERS + PRODUCERS) / 2; j++) {
    9494                        for (k = 0; k < i; k++) {
     
    109109                        }
    110110                }
    111                
     111
    112112                TPRINTF("ok\n");
    113                
     113
    114114                thread_sleep(1);
    115115                waitq_wakeup(&can_start, WAKEUP_ALL);
    116                
     116
    117117                while ((items_consumed.count != consumers) || (items_produced.count != producers)) {
    118118                        TPRINTF("%" PRIua " consumers remaining, %" PRIua " producers remaining\n",
     
    121121                }
    122122        }
    123        
     123
    124124        return NULL;
    125125}
Note: See TracChangeset for help on using the changeset viewer.