From 99aeca003b9cb8078ecc74aa693bb64caf6ae530 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 8 Mar 2011 15:31:49 +0000 Subject: [PATCH] Fixed indentation --- src/OpenThreads/pthreads/PThreadBarrier.cpp | 16 ++++----- src/OpenThreads/pthreads/PThreadCondition.cpp | 34 +++++++++---------- src/OpenThreads/pthreads/PThreadMutex.cpp | 18 +++++----- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/OpenThreads/pthreads/PThreadBarrier.cpp b/src/OpenThreads/pthreads/PThreadBarrier.cpp index 849bf019d..e5d9a276d 100644 --- a/src/OpenThreads/pthreads/PThreadBarrier.cpp +++ b/src/OpenThreads/pthreads/PThreadBarrier.cpp @@ -87,17 +87,17 @@ Barrier::Barrier(int numThreads) { if(sysconf(_POSIX_THREAD_PRIO_INHERIT)) { - pthread_mutexattr_setprotocol(&mutex_attr, PTHREAD_PRIO_INHERIT); - + pthread_mutexattr_setprotocol(&mutex_attr, PTHREAD_PRIO_INHERIT); + } else if (sysconf(_POSIX_THREAD_PRIO_PROTECT)) { - int th_policy; - struct sched_param th_param; - pthread_getschedparam(pthread_self(), &th_policy, &th_param); + int th_policy; + struct sched_param th_param; + pthread_getschedparam(pthread_self(), &th_policy, &th_param); - pthread_mutexattr_setprotocol(&mutex_attr, PTHREAD_PRIO_PROTECT); - pthread_mutexattr_setprioceiling(&mutex_attr, - sched_get_priority_max(th_policy)); + pthread_mutexattr_setprotocol(&mutex_attr, PTHREAD_PRIO_PROTECT); + pthread_mutexattr_setprioceiling(&mutex_attr, + sched_get_priority_max(th_policy)); } diff --git a/src/OpenThreads/pthreads/PThreadCondition.cpp b/src/OpenThreads/pthreads/PThreadCondition.cpp index 3fc3b6c77..33a2aae3e 100644 --- a/src/OpenThreads/pthreads/PThreadCondition.cpp +++ b/src/OpenThreads/pthreads/PThreadCondition.cpp @@ -36,24 +36,24 @@ int gettimeofday(struct timeval* tp, void* tzp) { LARGE_INTEGER t; if(QueryPerformanceCounter(&t)) { - /* hardware supports a performance counter */ - static int been_here = 0; - static LARGE_INTEGER f; - if( !been_here ) - { - been_here = 1; - QueryPerformanceFrequency(&f); - } - tp->tv_sec = t.QuadPart/f.QuadPart; - tp->tv_usec = ((float)t.QuadPart/f.QuadPart*1000*1000) - - (tp->tv_sec*1000*1000); + /* hardware supports a performance counter */ + static int been_here = 0; + static LARGE_INTEGER f; + if( !been_here ) + { + been_here = 1; + QueryPerformanceFrequency(&f); + } + tp->tv_sec = t.QuadPart/f.QuadPart; + tp->tv_usec = ((float)t.QuadPart/f.QuadPart*1000*1000) + - (tp->tv_sec*1000*1000); } else { - /* hardware doesn't support a performance counter, so get the - time in a more traditional way. */ - DWORD t; - t = timeGetTime(); - tp->tv_sec = t / 1000; - tp->tv_usec = t % 1000; + /* hardware doesn't support a performance counter, so get the + time in a more traditional way. */ + DWORD t; + t = timeGetTime(); + tp->tv_sec = t / 1000; + tp->tv_usec = t % 1000; } /* 0 indicates that the call succeeded. */ diff --git a/src/OpenThreads/pthreads/PThreadMutex.cpp b/src/OpenThreads/pthreads/PThreadMutex.cpp index b9dfbfb0a..6da203910 100644 --- a/src/OpenThreads/pthreads/PThreadMutex.cpp +++ b/src/OpenThreads/pthreads/PThreadMutex.cpp @@ -75,18 +75,18 @@ Mutex::Mutex(MutexType type): #if defined (_POSIX_THREAD_PRIO_INHERIT) || defined (_POSIX_THREAD_PRIO_PROTECT) // [ if(sysconf(_POSIX_THREAD_PRIO_INHERIT)) { - - pthread_mutexattr_setprotocol(&mutex_attr, PTHREAD_PRIO_INHERIT); - + + pthread_mutexattr_setprotocol(&mutex_attr, PTHREAD_PRIO_INHERIT); + } else if (sysconf(_POSIX_THREAD_PRIO_PROTECT)) { - int th_policy; - struct sched_param th_param; - pthread_getschedparam(pthread_self(), &th_policy, &th_param); + int th_policy; + struct sched_param th_param; + pthread_getschedparam(pthread_self(), &th_policy, &th_param); - pthread_mutexattr_setprotocol(&mutex_attr, PTHREAD_PRIO_PROTECT); - pthread_mutexattr_setprioceiling(&mutex_attr, - sched_get_priority_max(th_policy)); + pthread_mutexattr_setprotocol(&mutex_attr, PTHREAD_PRIO_PROTECT); + pthread_mutexattr_setprioceiling(&mutex_attr, + sched_get_priority_max(th_policy)); }