<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>75657</bug_id>
          
          <creation_ts>2012-01-05 15:22:05 -0800</creation_ts>
          <short_desc>WTF::yield() conflicts with unistd.h when building with Solaris Studio 12.3</short_desc>
          <delta_ts>2022-07-12 13:16:47 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Template Framework</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Pavel Heimlich (hajma)">tropikhajma</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>levin</cc>
    
    <cc>michaeln</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>530689</commentid>
    <comment_count>0</comment_count>
    <who name="Pavel Heimlich (hajma)">tropikhajma</who>
    <bug_when>2012-01-05 15:22:05 -0800</bug_when>
    <thetext>when building qt 4.8, the included webkit fails to build with the below error.

I found this patch helped me to move on, but I don&apos;t really speak c++ so I&apos;m not sure if this is the correct way:
--- ./wtf/Threading.h.orig      Thu Jan  5 23:10:38 2012
+++ ./wtf/Threading.h   Thu Jan  5 23:11:14 2012
@@ -113,6 +113,6 @@
 using WTF::currentThread;
 using WTF::detachThread;
 using WTF::waitForThreadCompletion;
-using WTF::yield;
+//using WTF::yield;
 
 #endif // Threading_h



I&apos;m ready to come up with proper patch along the webkit rules, but please let me know if the direction is ok.

-bash-4.1$ cd ~/packages/BUILD/qt-4.8.0/i386/qt-everywhere-opensource-src-4.8.0/src/3rdparty/webkit/Source/JavaScriptCore/
-bash-4.1$ gmake VERBOSE=1
/opt/test2/packages/BUILD/qt-4.8.0/i386/qt-everywhere-opensource-src-4.8.0/bin/qmake -spec ../../../../../mkspecs/solaris-cc -o Makefile JavaScriptCore.pro
/opt/test2/SolarisStudio12.3-solaris-x86-bin/solarisstudio12.3/bin/CC -c -I../../../../../mkspecs/solaris-cc -I. -I../../../../../include/QtCore -I../../../../../include -I. -I../../Source -I../ThirdParty -Iassembler -Ibytecode -Ibytecompiler -Iheap -Idfg -Idebugger -Iinterpreter -Ijit -Iparser -Iprofiler -Iruntime -Iwtf -Iwtf/gobject -I/opt/test2/packages/BUILD/qt-4.8.0/i386/qt-everywhere-opensource-src-4.8.0/src/3rdparty/webkit/Source/JavaScriptCore/wtf/symbian -Iwtf/unicode -Iyarr -IAPI -IForwardingHeaders -Igenerated -I../../Source -I../../include -I/include/QtWebKit -I/include -I.moc/debug-static -I/usr/sfw/include -D_REENTRANT -DNDEBUG -D__EXTENSIONS__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS -DNO_DEBUG -D_UNICODE -DUNICODE -D_RWSTD_REENTRANT -D_XOPEN_SOURCE=500 -D_XPG5 -I/opt/kde4/include -m32 -xarch=sse2 -features=extensions,nestedaccess,tmplrefstatic -template=geninlinefuncs -s -xlang=c99 -xustr=ascii_utf16_ushort -Qoption ccfe -features=gcc -Qoption ccfe -features=zla -Qoption ccfe ++boolflag:sunwcch=false -R/opt/kde4/lib -library=stdcxx4 -lCrun -I/usr/include/libpng14 -I/opt/kde4/include -I/usr/mysql/5.1/include/mysql -I/usr/include/libmng -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/odbc -KPIC -mt -DNDEBUG -DBUILDING_QT__=1 -DQT_ASCII_CAST_WARNINGS -DBUILDING_JavaScriptCore -DBUILDING_WTF -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_SHARED -o .obj/debug-static/YarrInterpreter.o yarr/YarrInterpreter.cpp
&quot;./wtf/text/StringImplBase.h&quot;, line 46: Warning: Identifier expected instead of &quot;}&quot;.
&quot;yarr/YarrPattern.h&quot;, line 86: Warning: Identifier expected instead of &quot;}&quot;.
&quot;yarr/YarrPattern.h&quot;, line 99: Warning: Identifier expected instead of &quot;}&quot;.
&quot;yarr/YarrPattern.h&quot;, line 113: Warning: Types cannot be declared in anonymous union.
&quot;yarr/YarrPattern.h&quot;, line 201: Warning: type hides JSC::Yarr::PatternTerm::type.
&quot;yarr/YarrInterpreter.h&quot;, line 74: Warning: Identifier expected instead of &quot;}&quot;.
&quot;yarr/YarrInterpreter.h&quot;, line 85: Warning: Types cannot be declared in anonymous union.
&quot;yarr/YarrInterpreter.h&quot;, line 99: Warning: Types cannot be declared in anonymous union.
&quot;./wtf/OSAllocator.h&quot;, line 43: Warning: Identifier expected instead of &quot;}&quot;.
&quot;/usr/include/unistd.h&quot;, line 533: Error: WTF::yield() was declared before with a different language.
&quot;yarr/YarrInterpreter.cpp&quot;, line 153: Warning: output hides JSC::Yarr::Interpreter::output.
1 Error(s) and 10 Warning(s) detected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>530950</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-01-05 23:19:57 -0800</bug_when>
    <thetext>Such change would break the build, as is thus not acceptable.

However, I&apos;m not sure if we really need to implement yield() - it looks like it&apos;s only used once, as added in bug 42843, without much explanation of why it was needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>531348</commentid>
    <comment_count>2</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2012-01-06 13:44:58 -0800</bug_when>
    <thetext>Michael, do you know why the yield statement is needed in the sql code from bug 42843?

Could it be removed? (Or replace with something else?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>531382</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Nordman">michaeln</who>
    <bug_when>2012-01-06 14:05:37 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; Michael, do you know why the yield statement is needed in the sql code from bug 42843?
&gt; 
&gt; Could it be removed? (Or replace with something else?)

Looks like the problem is that &quot;using WTF::yeild&quot; in a .h file puts a very generic function name in the global namespace. We could change the name of the WTF::yeild() function to be less generic. Or better yet, avoid &apos;using&apos; it and require callers (ap says there&apos;s only one) to fully qualify the function name.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>531397</commentid>
    <comment_count>4</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2012-01-06 14:17:00 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; Michael, do you know why the yield statement is needed in the sql code from bug 42843?
&gt; &gt; 
&gt; &gt; Could it be removed? (Or replace with something else?)
&gt; 
&gt; Looks like the problem is that &quot;using WTF::yeild&quot; in a .h file puts a very generic function name in the global namespace. We could change the name of the WTF::yeild() function to be less generic. Or better yet, avoid &apos;using&apos; it and require callers (ap says there&apos;s only one) to fully qualify the function name.

Michael, here is the one instance:   http://trac.webkit.org/browser/trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp#L128

which is why I was asking you :).

Maybe the answer is: Feel free to submit a patch which removes the &quot;using&quot; statement and changes SQLiteDatabase.cpp to WTF::yield?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>531405</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-01-06 14:24:00 -0800</bug_when>
    <thetext>&gt; Maybe the answer is: Feel free to submit a patch which removes the &quot;using&quot; statement and changes SQLiteDatabase.cpp to WTF::yield?

I don&apos;t think that this is the best solution. We export all public functions from WTF into global namespace, so having an exception because of a rare platform seems wrong.

Renaming the function or removing it altogether seems better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>531410</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Nordman">michaeln</who>
    <bug_when>2012-01-06 14:32:04 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; &gt; Maybe the answer is: Feel free to submit a patch which removes the &quot;using&quot; statement and changes SQLiteDatabase.cpp to WTF::yield?
&gt; 
&gt; I don&apos;t think that this is the best solution. We export all public functions from WTF into global namespace, so having an exception because of a rare platform seems wrong.

Interesting that this comes up with the &quot;[chromium-dev] Pros and cons of &quot;using namespace&quot; (WAS: Consensus on when to use &quot;using&quot; directives)&quot; discussion active.

&gt; Renaming the function or removing it altogether seems better.

Feel free to submit a patch which removes the &quot;using&quot; statement and explicitly calls WTF::yeild, or to rename it to something that doesn&apos;t collide like wtfYield(). Pretty clear that yield() is used here to prevent this method from starving other threads of cpu. It&apos;s probably not a good idea to just remove it.

120    void SQLiteDatabase::interrupt()
121    {
122        m_interrupted = true;
123        while (!m_lockingMutex.tryLock()) {
124            MutexLocker locker(m_databaseClosingMutex);
125            if (!m_db)
126                return;
127            sqlite3_interrupt(m_db);
128            yield();
129        }
130    
131        m_lockingMutex.unlock();
132    }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1882437</commentid>
    <comment_count>7</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-12 11:24:24 -0700</bug_when>
    <thetext>Qt framework support for Webkit build is no longer present and there is no active build bots for QtWebkit. Can this be marked as &quot;RESOLVED WONTFIX&quot;?

Further - in Webkit Github source, there is only following reference to &quot;yield&apos; in &quot;threading.h&quot; file:

https://github.com/WebKit/WebKit/blob/fff69b8fe7b721effabdc81a70cbdf9926de3262/Source/WTF/wtf/Threading.h#L200

Additionally, based on Comment 04, the file does not have any &quot;USING&quot; word anymore (used CMD+F to find):

https://github.com/WebKit/WebKit/blob/6fe0158b88e945a7d11ae3d3c68ee8acd6cbef81/Source/WebCore/platform/sql/SQLiteDatabase.cpp

I think this can be closed. Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>