Changeset a35b458 in mainline for uspace/lib/c/generic/thread.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
  • uspace/lib/c/generic/thread.c

    r3061bc1 ra35b458  
    6565        if (fibril == NULL)
    6666                thread_exit(0);
    67        
     67
    6868        __tcb_set(fibril->tcb);
    69        
     69
    7070#ifdef FUTEX_UPGRADABLE
    7171        rcu_register_fibril();
    7272        futex_upgrade_all_and_wait();
    7373#endif
    74        
     74
    7575        uarg->uspace_thread_function(uarg->uspace_thread_arg);
    7676        /*
     
    8080         * free(uarg);
    8181         */
    82        
     82
    8383        /* If there is a manager, destroy it */
    8484        async_destroy_manager();
     
    8787        rcu_deregister_fibril();
    8888#endif
    89        
     89
    9090        fibril_teardown(fibril, false);
    91        
     91
    9292        thread_exit(0);
    9393}
     
    112112        if (!uarg)
    113113                return ENOMEM;
    114        
     114
    115115        size_t stack_size = stack_size_get();
    116116        void *stack = as_area_create(AS_AREA_ANY, stack_size,
     
    121121                return ENOMEM;
    122122        }
    123        
     123
    124124        /* Make heap thread safe. */
    125125        malloc_enable_multithreaded();
    126        
     126
    127127        uarg->uspace_entry = (void *) FADDR(__thread_entry);
    128128        uarg->uspace_stack = stack;
     
    131131        uarg->uspace_thread_arg = arg;
    132132        uarg->uspace_uarg = uarg;
    133        
     133
    134134        errno_t rc = (errno_t) __SYSCALL4(SYS_THREAD_CREATE, (sysarg_t) uarg,
    135135            (sysarg_t) name, (sysarg_t) str_size(name), (sysarg_t) tid);
    136        
     136
    137137        if (rc != EOK) {
    138138                /*
     
    143143                free(uarg);
    144144        }
    145        
     145
    146146        return rc;
    147147}
     
    155155{
    156156        __SYSCALL1(SYS_THREAD_EXIT, (sysarg_t) status);
    157        
     157
    158158        /* Unreachable */
    159159        while (1);
     
    214214         * full argument range
    215215         */
    216        
     216
    217217        while (sec > 0) {
    218218                unsigned int period = (sec > 1000) ? 1000 : sec;
    219                
     219
    220220                thread_usleep(period * 1000000);
    221221                sec -= period;
    222222        }
    223        
     223
    224224        return 0;
    225225}
Note: See TracChangeset for help on using the changeset viewer.