diff --git a/server/core/thread.c b/server/core/thread.c index ac8095b38..71ebbd9e6 100644 --- a/server/core/thread.c +++ b/server/core/thread.c @@ -23,8 +23,8 @@ * @verbatim * Revision History * - * Date Who Description - * 25/06/13 Mark Riddoch Initial implementation + * Date Who Description + * 25/06/13 Mark Riddoch Initial implementation * * @endverbatim */ @@ -33,46 +33,46 @@ /** * Start a polling thread * - * @param entry The entry point to call - * @param arg The argument to pass the thread entry point - * @return The thread handle + * @param entry The entry point to call + * @param arg The argument to pass the thread entry point + * @return The thread handle */ void * thread_start(void (*entry)(void *), void *arg) { -pthread_t thd; + pthread_t thd; - if (pthread_create(&thd, NULL, (void *(*)(void *))entry, arg) != 0) - { - return NULL; - } - return (void *)thd; + if (pthread_create(&thd, NULL, (void *(*)(void *))entry, arg) != 0) + { + return NULL; + } + return (void *)thd; } /** * Wait for a running threads to complete. * - * @param thd The thread handle + * @param thd The thread handle */ void thread_wait(void *thd) { -void *rval; + void *rval; - pthread_join((pthread_t)thd, &rval); + pthread_join((pthread_t)thd, &rval); } /** * Put the thread to sleep for a number of milliseconds * - * @param ms Number of milliseconds to sleep + * @param ms Number of milliseconds to sleep */ void thread_millisleep(int ms) { -struct timespec req; + struct timespec req; - req.tv_sec = ms / 1000; - req.tv_nsec = (ms % 1000) * 1000000; - nanosleep(&req, NULL); + req.tv_sec = ms / 1000; + req.tv_nsec = (ms % 1000) * 1000000; + nanosleep(&req, NULL); } diff --git a/server/include/thread.h b/server/include/thread.h index 9d391b9d7..b8ba8471a 100644 --- a/server/include/thread.h +++ b/server/include/thread.h @@ -20,7 +20,7 @@ #include /** - * @file thread.h The gateway threading interface + * @file thread.h The gateway threading interface * * An encapsulation of the threading used by the gateway. This is designed to * isolate the majority of the gateway code from th epthread library, enabling @@ -28,11 +28,11 @@ * of changes. */ -#define THREAD pthread_t -#define THREAD_SHELF pthread_self +#define THREAD pthread_t +#define THREAD_SHELF pthread_self -extern void *thread_start(void (*entry)(void *), void *arg); -extern void thread_wait(void *thd); -extern void thread_millisleep(int ms); +extern void *thread_start(void (*entry)(void *), void *arg); +extern void thread_wait(void *thd); +extern void thread_millisleep(int ms); #endif