mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00:00
Update brace style.
Add braces around single-line blocks, and remove line breaks before function-opening braces. This resolves #537.
This commit is contained in:
@@ -3,8 +3,7 @@
|
||||
#define NTHREADS 2
|
||||
#define NINCRS 2000000
|
||||
|
||||
TEST_BEGIN(test_mtx_basic)
|
||||
{
|
||||
TEST_BEGIN(test_mtx_basic) {
|
||||
mtx_t mtx;
|
||||
|
||||
assert_false(mtx_init(&mtx), "Unexpected mtx_init() failure");
|
||||
@@ -20,8 +19,7 @@ typedef struct {
|
||||
} thd_start_arg_t;
|
||||
|
||||
static void *
|
||||
thd_start(void *varg)
|
||||
{
|
||||
thd_start(void *varg) {
|
||||
thd_start_arg_t *arg = (thd_start_arg_t *)varg;
|
||||
unsigned i;
|
||||
|
||||
@@ -33,26 +31,26 @@ thd_start(void *varg)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
TEST_BEGIN(test_mtx_race)
|
||||
{
|
||||
TEST_BEGIN(test_mtx_race) {
|
||||
thd_start_arg_t arg;
|
||||
thd_t thds[NTHREADS];
|
||||
unsigned i;
|
||||
|
||||
assert_false(mtx_init(&arg.mtx), "Unexpected mtx_init() failure");
|
||||
arg.x = 0;
|
||||
for (i = 0; i < NTHREADS; i++)
|
||||
for (i = 0; i < NTHREADS; i++) {
|
||||
thd_create(&thds[i], thd_start, (void *)&arg);
|
||||
for (i = 0; i < NTHREADS; i++)
|
||||
}
|
||||
for (i = 0; i < NTHREADS; i++) {
|
||||
thd_join(thds[i], NULL);
|
||||
}
|
||||
assert_u_eq(arg.x, NTHREADS * NINCRS,
|
||||
"Race-related counter corruption");
|
||||
}
|
||||
TEST_END
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
main(void) {
|
||||
return (test(
|
||||
test_mtx_basic,
|
||||
test_mtx_race));
|
||||
|
||||
Reference in New Issue
Block a user