[Qt-interest] Documentation on Mutex, Semaphore and Critical Section with Qt?

Thiago Macieira thiago at kde.org
Fri Jan 29 18:03:09 CET 2010


Em Sexta-feira 29. Janeiro 2010, às 16.07.14, Arnold Krille escreveu:
> On Friday 29 January 2010 15:33:50 Matthias Pospiech wrote:
> > I do not see the difference between QReadWriteLock and a combination of
> > QWriteLocker and QReadLocker,
> > especially because in your approach it would be two different lockers
> > which have nothing to do with each other?
> 
> No, the Lockers are just convenience objects to lock the mutex/lock on
> creation and automatically unlock them on deletion. That is regardless
> where your functions exits, as soon as the locker goes out-of-scope, the
> mutex is unlocked. Very handy for functions with multiple exit-points.

I also like the QLockedMutexUnlocker class :-)

http://qt.gitorious.org/qt/qt/blobs/7604f8087f88171ef933d8ae08f501467e647338/src/corelib/kernel/qcoreapplication.cpp#line93

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100129/0558d092/attachment.bin 


More information about the Qt-interest-old mailing list