<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.5"/> <title>libyui: YPerThreadLogInfo Struct Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">libyui  <span id="projectnumber">3.0.10</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.5 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('structYPerThreadLogInfo.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Friends</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pub-attribs">Public Attributes</a> | <a href="structYPerThreadLogInfo-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">YPerThreadLogInfo Struct Reference</div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a1a9c142d69eadfa00c1425d2471aad61"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="structYPerThreadLogInfo.html#a1a9c142d69eadfa00c1425d2471aad61">YPerThreadLogInfo</a> ()</td></tr> <tr class="separator:a1a9c142d69eadfa00c1425d2471aad61"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a33dc71c1e649c171708a3a076dcc270f"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="structYPerThreadLogInfo.html#a33dc71c1e649c171708a3a076dcc270f">~YPerThreadLogInfo</a> ()</td></tr> <tr class="separator:a33dc71c1e649c171708a3a076dcc270f"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a8c2c4a134c25f6120a18f2977894a476"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="structYPerThreadLogInfo.html#a8c2c4a134c25f6120a18f2977894a476">isThread</a> (pthread_t otherThreadHandle)</td></tr> <tr class="separator:a8c2c4a134c25f6120a18f2977894a476"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a> Public Attributes</h2></td></tr> <tr class="memitem:a5813f2a5c1669735a8c83b55ca3fb27b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5813f2a5c1669735a8c83b55ca3fb27b"></a> pthread_t </td><td class="memItemRight" valign="bottom"><b>threadHandle</b></td></tr> <tr class="separator:a5813f2a5c1669735a8c83b55ca3fb27b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a7d2b5aaba7a049e5c54943edc5102cd7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7d2b5aaba7a049e5c54943edc5102cd7"></a> <a class="el" href="classYUILogBuffer.html">YUILogBuffer</a> </td><td class="memItemRight" valign="bottom"><b>logBuffer</b></td></tr> <tr class="separator:a7d2b5aaba7a049e5c54943edc5102cd7"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a720d48a5c9c29e16c4b1e0db28b6fbe9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a720d48a5c9c29e16c4b1e0db28b6fbe9"></a> std::ostream </td><td class="memItemRight" valign="bottom"><b>logStream</b></td></tr> <tr class="separator:a720d48a5c9c29e16c4b1e0db28b6fbe9"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Helper class: Per-thread logging information.</p> <p>Multiple threads can easily clobber each others' half-done logging. A naive approach to prevent this would be to lock a mutex when a thread starts logging and unlock it when it's done logging. But that "when it's done" condition might never come true. std::endl or a newline in the output stream would be one indication, but there is no way to make sure there always is such a delimiter. If it is forgotten and that thread (that still has the mutex locked) runs into a waiting condition itself (e.g., UI thread synchronization with pipes), there would be a deadlock.</p> <p>So this much safer approach was chosen: Give each thread its own logging infrastructure, i.e., its own log stream and its own log buffer.</p> <p>Sure, in bad cases the logger function might still be executed in parallel and thus clobber a line or two of log output. But that's merely bad output formatting, not writing another thread's data structures without control - which can easily happen if multiple threads are working on the same output buffer, i.e. manipulate the same string. </p> <p>Definition at line <a class="el" href="YUILog_8cc_source.html#l00208">208</a> of file <a class="el" href="YUILog_8cc_source.html">YUILog.cc</a>.</p> </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> <a class="anchor" id="a1a9c142d69eadfa00c1425d2471aad61"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">YPerThreadLogInfo::YPerThreadLogInfo </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Constructor </p> <p>Definition at line <a class="el" href="YUILog_8cc_source.html#l00213">213</a> of file <a class="el" href="YUILog_8cc_source.html">YUILog.cc</a>.</p> </div> </div> <a class="anchor" id="a33dc71c1e649c171708a3a076dcc270f"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">YPerThreadLogInfo::~YPerThreadLogInfo </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Destructor </p> <p>Definition at line <a class="el" href="YUILog_8cc_source.html#l00224">224</a> of file <a class="el" href="YUILog_8cc_source.html">YUILog.cc</a>.</p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a8c2c4a134c25f6120a18f2977894a476"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool YPerThreadLogInfo::isThread </td> <td>(</td> <td class="paramtype">pthread_t </td> <td class="paramname"><em>otherThreadHandle</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Check if this per-thread logging information belongs to the specified thread. </p> <p>Definition at line <a class="el" href="YUILog_8cc_source.html#l00232">232</a> of file <a class="el" href="YUILog_8cc_source.html">YUILog.cc</a>.</p> </div> </div> <hr/>The documentation for this struct was generated from the following file:<ul> <li>/home/iurt/rpmbuild/BUILD/libyui-3.0.10-b316a3f/src/<a class="el" href="YUILog_8cc_source.html">YUILog.cc</a></li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="structYPerThreadLogInfo.html">YPerThreadLogInfo</a></li> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.5 </li> </ul> </div> </body> </html>