From 2235ed1f86771240b9d29261194df04be80eac38 Mon Sep 17 00:00:00 2001
From: Henry Weller <http://openfoam.org>
Date: Sun, 10 Dec 2017 11:08:29 +0000
Subject: [PATCH] STYLE: OSspecific/POSIX: Updated function name in diagnostic
 messages

Patch contributed by Bruno Santos
Resolves bug-report https://bugs.openfoam.org/view.php?id=2786
---
 src/OSspecific/POSIX/POSIX.C | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C
index a24b6fab2c4..5e1f8599121 100644
--- a/src/OSspecific/POSIX/POSIX.C
+++ b/src/OSspecific/POSIX/POSIX.C
@@ -1689,7 +1689,7 @@ Foam::label Foam::allocateThread()
         {
             if (POSIX::debug)
             {
-                Pout<< "allocateThread : reusing index:" << i << endl;
+                Pout<< FUNCTION_NAME << " : reusing index:" << i << endl;
             }
             // Reuse entry
             threads_[i].reset(new pthread_t());
@@ -1700,7 +1700,7 @@ Foam::label Foam::allocateThread()
     const label index = threads_.size();
     if (POSIX::debug)
     {
-        Pout<< "allocateThread : new index:" << index << endl;
+        Pout<< FUNCTION_NAME << " : new index:" << index << endl;
     }
     threads_.append(autoPtr<pthread_t>(new pthread_t()));
 
@@ -1717,7 +1717,7 @@ void Foam::createThread
 {
     if (POSIX::debug)
     {
-        Pout<< "createThread : index:" << index << endl;
+        Pout<< FUNCTION_NAME << " : index:" << index << endl;
     }
     if (pthread_create(&threads_[index](), nullptr, start_routine, arg))
     {
@@ -1731,11 +1731,11 @@ void Foam::joinThread(const label index)
 {
     if (POSIX::debug)
     {
-        Pout<< "freeThread : join:" << index << endl;
+        Pout<< FUNCTION_NAME << " : index:" << index << endl;
     }
     if (pthread_join(threads_[index](), nullptr))
     {
-        FatalErrorInFunction << "Failed freeing thread " << index
+        FatalErrorInFunction << "Failed joining thread " << index
             << exit(FatalError);
     }
 }
@@ -1745,7 +1745,7 @@ void Foam::freeThread(const label index)
 {
     if (POSIX::debug)
     {
-        Pout<< "freeThread : index:" << index << endl;
+        Pout<< FUNCTION_NAME << " : index:" << index << endl;
     }
     threads_[index].clear();
 }
@@ -1759,7 +1759,7 @@ Foam::label Foam::allocateMutex()
         {
             if (POSIX::debug)
             {
-                Pout<< "allocateMutex : reusing index:" << i << endl;
+                Pout<< FUNCTION_NAME << " : reusing index:" << i << endl;
             }
             // Reuse entry
             mutexes_[i].reset(new pthread_mutex_t());
@@ -1771,7 +1771,7 @@ Foam::label Foam::allocateMutex()
 
     if (POSIX::debug)
     {
-        Pout<< "allocateMutex : new index:" << index << endl;
+        Pout<< FUNCTION_NAME << " : new index:" << index << endl;
     }
     mutexes_.append(autoPtr<pthread_mutex_t>(new pthread_mutex_t()));
     return index;
@@ -1782,7 +1782,7 @@ void Foam::lockMutex(const label index)
 {
     if (POSIX::debug)
     {
-        Pout<< "lockMutex : index:" << index << endl;
+        Pout<< FUNCTION_NAME << " : index:" << index << endl;
     }
     if (pthread_mutex_lock(&mutexes_[index]()))
     {
@@ -1796,7 +1796,7 @@ void Foam::unlockMutex(const label index)
 {
     if (POSIX::debug)
     {
-        Pout<< "unlockMutex : index:" << index << endl;
+        Pout<< FUNCTION_NAME << " : index:" << index << endl;
     }
     if (pthread_mutex_unlock(&mutexes_[index]()))
     {
@@ -1810,7 +1810,7 @@ void Foam::freeMutex(const label index)
 {
     if (POSIX::debug)
     {
-        Pout<< "freeMutex : index:" << index << endl;
+        Pout<< FUNCTION_NAME << " : index:" << index << endl;
     }
     mutexes_[index].clear();
 }
-- 
GitLab