diff options
| author | Garrett D'Amore <garrett@damore.org> | 2016-12-22 01:57:10 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2016-12-22 01:57:10 -0800 |
| commit | 101c1b6a946d9f2f48c6dd89940ae669141e0511 (patch) | |
| tree | 4da688859d87526d03d724ab1a729c6846650eae /src/platform/posix/posix_thread.c | |
| parent | b92672e20420683e73bfc017956ac6ef2b6b793b (diff) | |
| download | nng-101c1b6a946d9f2f48c6dd89940ae669141e0511.tar.gz nng-101c1b6a946d9f2f48c6dd89940ae669141e0511.tar.bz2 nng-101c1b6a946d9f2f48c6dd89940ae669141e0511.zip | |
Use C99 structure initializers FTW. Various other changes.
Diffstat (limited to 'src/platform/posix/posix_thread.c')
| -rw-r--r-- | src/platform/posix/posix_thread.c | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/src/platform/posix/posix_thread.c b/src/platform/posix/posix_thread.c index 98b42d5c..8928974c 100644 --- a/src/platform/posix/posix_thread.c +++ b/src/platform/posix/posix_thread.c @@ -1,22 +1,13 @@ -/* - * Copyright 2016 Garrett D'Amore <garrett@damore.org> - * - * This software is supplied under the terms of the MIT License, a - * copy of which should be located in the distribution where this - * file was obtained (LICENSE.txt). A copy of the license may also be - * found online at https://opensource.org/licenses/MIT. - */ - -/* - * This is more of a direct #include of a .c rather than .h file. - * But having it be a .h makes compiler rules work out properly. Do - * not include this more than once into your program, or you will - * get multiple symbols defined. - */ - -/* - * POSIX threads. - */ +// +// Copyright 2016 Garrett D'Amore <garrett@damore.org> +// +// This software is supplied under the terms of the MIT License, a +// copy of which should be located in the distribution where this +// file was obtained (LICENSE.txt). A copy of the license may also be +// found online at https://opensource.org/licenses/MIT. +// + +// POSIX threads. #include "core/nng_impl.h" @@ -95,10 +86,10 @@ nni_plat_init(int (*helper)(void)) nni_panic("nng is fork-reentrant safe"); } if (plat_init) { - return (0); /* fast path */ + return (0); // fast path } pthread_mutex_lock(&plat_lock); - if (plat_init) { /* check again under the lock to be sure */ + if (plat_init) { // check again under the lock to be sure pthread_mutex_unlock(&plat_lock); return (0); } @@ -118,7 +109,7 @@ nni_plat_init(int (*helper)(void)) void nni_plat_fini(void) { - /* XXX: NOTHING *YET* */ + // XXX: NOTHING *YET* } |
