~ubuntu-branches/ubuntu/trusty/python-qt4/trusty-proposed

« back to all changes in this revision

Viewing changes to doc/html/qwritelocker.html

  • Committer: Package Import Robot
  • Author(s): Dmitry Shachnev
  • Date: 2013-11-20 12:25:42 UTC
  • mfrom: (1.6.5)
  • Revision ID: package-import@ubuntu.com-20131120122542-fnbdlwaadst5y0h7
Tags: 4.10.3+dfsg1-1
* get-orig-source.sh: Only remove the _static folder, as we still
  need some files in html that are not generated by Sphinx.
* Re-add debian/python-qt4-doc.docs (closes: #729993).
* Remove obsolete README.debian, examples work fine now.
* Do not install Windows-specific activeqt examples.
* Add description to debian_configure_changes.diff.
* Remove leftover debug output from debian/rules.
* Symlink duplicate files in examples using fdupes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
3
<html><head><title>QWriteLocker Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
 
4
a:link { color: #004faf; text-decoration: none }
 
5
a:visited { color: #672967; text-decoration: none }
 
6
td.postheader { font-family: sans-serif }
 
7
tr.address { font-family: sans-serif }
 
8
body { background: #ffffff; color: black; }
 
9
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QWriteLocker Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QWriteLocker class is a convenience class that simplifies
 
10
locking and unlocking read-write locks for write access. <a href="#details">More...</a></p>
 
11
 
 
12
<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qwritelocker.html#QWriteLocker">__init__</a></b> (<i>self</i>, QReadWriteLock&#160;<i>areadWriteLock</i>)</li><li><div class="fn" />QReadWriteLock <b><a href="qwritelocker.html#readWriteLock">readWriteLock</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwritelocker.html#relock">relock</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwritelocker.html#unlock">unlock</a></b> (<i>self</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />object <b><a href="qwritelocker.html#__enter__">__enter__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwritelocker.html#__exit__">__exit__</a></b> (<i>self</i>, object&#160;<i>type</i>, object&#160;<i>value</i>, object&#160;<i>traceback</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QWriteLocker class is a convenience class that simplifies
 
13
locking and unlocking read-write locks for write access.</p>
 
14
<p>The purpose of QWriteLocker (and <a href="qreadlocker.html">QReadLocker</a> is to simplify <a href="qreadwritelock.html">QReadWriteLock</a> locking and unlocking.
 
15
Locking and unlocking statements or in exception handling code is
 
16
error-prone and difficult to debug. QWriteLocker can be used in
 
17
such situations to ensure that the state of the lock is always
 
18
well-defined.</p>
 
19
<p>Here's an example that uses QWriteLocker to lock and unlock a
 
20
read-write lock for writing:</p>
 
21
<pre class="cpp">
 
22
 <span class="type"><a href="qreadwritelock.html">QReadWriteLock</a></span> lock;
 
23
 
 
24
 <span class="type">void</span> writeData(<span class="keyword">const</span> <span class="type"><a href="qbytearray.html">QByteArray</a></span> <span class="operator">&amp;</span>data)
 
25
 {
 
26
     <span class="type">QWriteLocker</span> locker(<span class="operator">&amp;</span>lock);
 
27
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 
28
 }
 
29
</pre>
 
30
<p>It is equivalent to the following code:</p>
 
31
<pre class="cpp">
 
32
 <span class="type"><a href="qreadwritelock.html">QReadWriteLock</a></span> lock;
 
33
 
 
34
 <span class="type">void</span> writeData(<span class="keyword">const</span> <span class="type"><a href="qbytearray.html">QByteArray</a></span> <span class="operator">&amp;</span>data)
 
35
 {
 
36
     lock<span class="operator">.</span>lockForWrite();
 
37
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 
38
     lock<span class="operator">.</span>unlock();
 
39
 }
 
40
</pre>
 
41
<p>The <a href="qmutexlocker.html">QMutexLocker</a> documentation
 
42
shows examples where the use of a locker object greatly simplifies
 
43
programming.</p>
 
44
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QWriteLocker" />QWriteLocker.__init__ (<i>self</i>, <a href="qreadwritelock.html">QReadWriteLock</a>&#160;<i>areadWriteLock</i>)</h3><p>Constructs a <a href="qwritelocker.html">QWriteLocker</a> and
 
45
locks <i>lock</i> for writing. The lock will be unlocked when the
 
46
<a href="qwritelocker.html">QWriteLocker</a> is destroyed. If
 
47
<tt>lock</tt> is zero, <a href="qwritelocker.html">QWriteLocker</a>
 
48
does nothing.</p>
 
49
<p><b>See also</b> <a href="qreadwritelock.html#lockForWrite">QReadWriteLock.lockForWrite</a>().</p>
 
50
 
 
51
 
 
52
<h3 class="fn"><a name="readWriteLock" /><a href="qreadwritelock.html">QReadWriteLock</a> QWriteLocker.readWriteLock (<i>self</i>)</h3><p>Returns a pointer to the read-write lock that was passed to the
 
53
constructor.</p>
 
54
 
 
55
 
 
56
<h3 class="fn"><a name="relock" />QWriteLocker.relock (<i>self</i>)</h3><p>Relocks an unlocked lock.</p>
 
57
<p><b>See also</b> <a href="qwritelocker.html#unlock">unlock</a>().</p>
 
58
 
 
59
 
 
60
<h3 class="fn"><a name="unlock" />QWriteLocker.unlock (<i>self</i>)</h3><p>Unlocks the lock associated with this locker.</p>
 
61
<p><b>See also</b> <a href="qreadwritelock.html#unlock">QReadWriteLock.unlock</a>().</p>
 
62
<h3 class="fn"><a name="__enter__" />object QWriteLocker.__enter__ (<i>self</i>)</h3><h3 class="fn"><a name="__exit__" />QWriteLocker.__exit__ (<i>self</i>, object&#160;<i>type</i>, object&#160;<i>value</i>, object&#160;<i>traceback</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.10.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.5</td></tr></table></div></address></body></html>
 
 
b'\\ No newline at end of file'