📄 qlock.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/kernel/qlock_qws.cpp:64 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QLock Class</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td valign=center> <a href="index.html"><font color="#004faf">Home</font></a> | <a href="classes.html"><font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</font></a></td><td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QLock Class Reference</h1><p>The QLock class is a wrapper for a System V shared semaphore.<a href="#details">More...</a><p><tt>#include <<a href="qlock_qws-h.html">qlock_qws.h</a>></tt><p><a href="qlock-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#QLock"><b>QLock</b></a> ( const QString & filename, char id, bool create = FALSE )</div></li><li><div class=fn><a href="#~QLock"><b>~QLock</b></a> ()</div></li><li><div class=fn>enum <a href="#Type-enum"><b>Type</b></a> { Read, Write }</div></li><li><div class=fn>bool <a href="#isValid"><b>isValid</b></a> () const</div></li><li><div class=fn>void <a href="#lock"><b>lock</b></a> ( Type t )</div></li><li><div class=fn>void <a href="#unlock"><b>unlock</b></a> ()</div></li><li><div class=fn>bool <a href="#locked"><b>locked</b></a> () const</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QLock class is a wrapper for a System V shared semaphore.<p> <p> It is used by Qt/Embedded for synchronizing access to the graphicscard and shared memory region between processes.<p>See also <a href="io.html">Input/Output and Networking</a> and <a href="qws.html">Qt/Embedded</a>.<hr><h2>Member Type Documentation</h2><h3 class=fn><a name="Type-enum"></a>QLock::Type</h3><ul><li><tt>QLock::Read</tt><li><tt>QLock::Write</tt></ul><hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QLock"></a>QLock::QLock ( const <a href="qstring.html">QString</a> & filename, char id, bool create = FALSE )</h3><p> Creates a lock. <em>filename</em> is the file path of the Unix-domainsocket the Qt/Embedded client is using. <em>id</em> is the name of theparticular lock to be created on that socket. If <em>create</em> is TRUEthe lock is to be created (as the Qt/Embedded server does); if <em>create</em> is FALSE the lock should exist already (as the Qt/Embeddedclient expects).<h3 class=fn><a name="~QLock"></a>QLock::~QLock ()</h3><p> Destroys a lock<h3 class=fn>bool <a name="isValid"></a>QLock::isValid () const</h3><p> Returns TRUE if the lock constructor was succesful; returns FALSE ifthe lock could not be created or was not available to connect to.<h3 class=fn>void <a name="lock"></a>QLock::lock ( <a href="qlock.html#Type-enum">Type</a> t )</h3>Locks the semaphore with a lock of type <em>t</em>. Locks can either be<a href="#Type-enum">Read</a> or <a href="#Type-enum">Write</a>. If a lock is <a href="#Type-enum">Read</a>, attempts by otherprocesses to obtain <a href="#Type-enum">Read</a> locks will succeed, and <a href="#Type-enum">Write</a>attempts will block until the lock is unlocked. If locked as <a href="#Type-enum">Write</a>, all attempts to lock by other processes will block untilthe lock is unlocked. Locks are stacked: i.e. a given QLock can belocked multiple times by the same process without blocking, andwill only be unlocked after a corresponding number of <a href="#unlock">unlock</a>()calls.<h3 class=fn>bool <a name="locked"></a>QLock::locked () const</h3><p> Returns TRUE if the lock is currently held by the current process;otherwise returns FALSE.<h3 class=fn>void <a name="unlock"></a>QLock::unlock ()</h3><p> Unlocks the semaphore. If other processes were blocking waiting to<a href="#lock">lock</a>() the semaphore, one of them will wake up and succeed inlock()ing.<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright © 1995-2002<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright © 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -