From: Jan Olszak Date: Fri, 28 Dec 2012 08:49:46 +0000 (+0100) Subject: [Prevent] Handle return value from pthread_setspecific. X-Git-Tag: 2.1b_release~6^2~82 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61a3315c3bf23d3a69c04e1bcbe115f927298255;p=framework%2Fweb%2Fwrt-commons.git [Prevent] Handle return value from pthread_setspecific. [Issue] Unhandled return value from pthread_setspecific [Bug] N/A [Cause] N/A [Solution] Log on errors. [Verification] Build commons. Change-Id: I9994b421626df10a27eef90899dc0645120c765d --- diff --git a/modules/core/src/thread.cpp b/modules/core/src/thread.cpp index 8dacad6..3974406 100644 --- a/modules/core/src/thread.cpp +++ b/modules/core/src/thread.cpp @@ -27,6 +27,7 @@ #include #include #include +#include namespace // anonymous { @@ -118,7 +119,12 @@ void *Thread::StaticThreadEntry(void *param) Assert(This != NULL); // Set thread specific - pthread_setspecific(g_threadSpecific.threadSpecific, This); + int result = pthread_setspecific(g_threadSpecific.threadSpecific, This); + + if (result!=0) + { + LogError("Failed to set threadSpecific. Error: " << strerror(result)); + } // Enter thread proc // Do not allow exceptions to hit pthread core