[commit: ghc] master: rts: delint/detab/dewhitespace OSThreads.c (3e0e489)
git at git.haskell.org
git at git.haskell.org
Mon Jul 28 14:34:55 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/3e0e489eec632a3a464eb2da166057f59fb9a274/ghc
>---------------------------------------------------------------
commit 3e0e489eec632a3a464eb2da166057f59fb9a274
Author: Austin Seipp <austin at well-typed.com>
Date: Mon Jul 21 10:35:42 2014 -0500
rts: delint/detab/dewhitespace OSThreads.c
Signed-off-by: Austin Seipp <austin at well-typed.com>
>---------------------------------------------------------------
3e0e489eec632a3a464eb2da166057f59fb9a274
rts/posix/OSThreads.c | 39 +++++++++++++++++++++------------------
1 file changed, 21 insertions(+), 18 deletions(-)
diff --git a/rts/posix/OSThreads.c b/rts/posix/OSThreads.c
index 13a176c..e627bab 100644
--- a/rts/posix/OSThreads.c
+++ b/rts/posix/OSThreads.c
@@ -18,7 +18,7 @@
#if defined(freebsd_HOST_OS)
/* Inclusion of system headers usually requires __BSD_VISIBLE on FreeBSD,
* because of some specific types, like u_char, u_int, etc. */
-#define __BSD_VISIBLE 1
+#define __BSD_VISIBLE 1
#endif
#include "Rts.h"
@@ -175,7 +175,7 @@ newThreadLocalKey (ThreadLocalKey *key)
{
int r;
if ((r = pthread_key_create(key, NULL)) != 0) {
- barf("newThreadLocalKey: %s", strerror(r));
+ barf("newThreadLocalKey: %s", strerror(r));
}
}
@@ -194,7 +194,7 @@ setThreadLocalVar (ThreadLocalKey *key, void *value)
{
int r;
if ((r = pthread_setspecific(*key,value)) != 0) {
- barf("setThreadLocalVar: %s", strerror(r));
+ barf("setThreadLocalVar: %s", strerror(r));
}
}
@@ -203,7 +203,7 @@ freeThreadLocalKey (ThreadLocalKey *key)
{
int r;
if ((r = pthread_key_delete(*key)) != 0) {
- barf("freeThreadLocalKey: %s", strerror(r));
+ barf("freeThreadLocalKey: %s", strerror(r));
}
}
@@ -222,7 +222,7 @@ forkOS_createThread ( HsStablePtr entry )
{
pthread_t tid;
int result = pthread_create(&tid, NULL,
- forkOS_createThreadWrapper, (void*)entry);
+ forkOS_createThreadWrapper, (void*)entry);
if(!result)
pthread_detach(tid);
return result;
@@ -278,32 +278,33 @@ setThreadAffinity (nat n, nat m GNUC3_ATTRIBUTE(__unused__))
policy.affinity_tag = n;
thread_policy_set(mach_thread_self(),
- THREAD_AFFINITY_POLICY,
- (thread_policy_t) &policy,
- THREAD_AFFINITY_POLICY_COUNT);
+ THREAD_AFFINITY_POLICY,
+ (thread_policy_t) &policy,
+ THREAD_AFFINITY_POLICY_COUNT);
}
#elif defined(HAVE_SYS_CPUSET_H) /* FreeBSD 7.1+ */
void
setThreadAffinity(nat n, nat m)
{
- nat nproc;
- cpuset_t cs;
- nat i;
+ nat nproc;
+ cpuset_t cs;
+ nat i;
- nproc = getNumberOfProcessors();
- CPU_ZERO(&cs);
+ nproc = getNumberOfProcessors();
+ CPU_ZERO(&cs);
- for (i = n; i < nproc; i += m)
- CPU_SET(i, &cs);
+ for (i = n; i < nproc; i += m)
+ CPU_SET(i, &cs);
- cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, -1, sizeof(cpuset_t), &cs);
+ cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID,
+ -1, sizeof(cpuset_t), &cs);
}
#else
void
setThreadAffinity (nat n GNUC3_ATTRIBUTE(__unused__),
- nat m GNUC3_ATTRIBUTE(__unused__))
+ nat m GNUC3_ATTRIBUTE(__unused__))
{
}
#endif
@@ -340,7 +341,9 @@ KernelThreadId kernelThreadId (void)
return pthread_getthreadid_np();
// Check for OS X >= 10.6 (see #7356)
-#elif defined(darwin_HOST_OS) && !(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
+#elif defined(darwin_HOST_OS) && \
+ !(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \
+ __MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
uint64_t ktid;
pthread_threadid_np(NULL, &ktid);
return ktid;
More information about the ghc-commits
mailing list