Results 1 to 4 of 4

Thread: Thread synchronization, QWaitCondition, and recursiveMutex

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Posts
    56
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    7
    Thanked 4 Times in 4 Posts

    Default Re: Thread synchronization, QWaitCondition, and recursiveMutex

    Quote Originally Posted by RThaden View Post
    Hi all,

    Something like
    Qt Code:
    1. QMetaObject::invokeMethod(xy_manager, "initialize", Qt::BlockingQueuedConnection);
    2. // wait here until initialize has finished.
    To copy to clipboard, switch view to plain text mode 
    Rainer
    Not sure about that: does the invokeMethod above with the BlockingQueuedConnection return when the signal has been delivered or when the desired slot has been fully executed? Last option would solve my problem.

    Kind regards,

    Rainer

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Thread synchronization, QWaitCondition, and recursiveMutex

    Quote Originally Posted by RThaden View Post
    Not sure about that: does the invokeMethod above with the BlockingQueuedConnection return when the signal has been delivered or when the desired slot has been fully executed?
    The blocking is done with a semaphore which is released in QMetaCallEvent destructor, so the sender is blocked as long as the meta call event object exists. AFAIK when event loop picks up the meta call event it first executes the slot and then deletes the event.

  3. The following user says thank you to jacek for this useful post:

    RThaden (28th August 2008)

  4. #3
    Join Date
    Jan 2008
    Posts
    56
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    7
    Thanked 4 Times in 4 Posts

    Thumbs up Re: Thread synchronization, QWaitCondition, and recursiveMutex

    Thanks jacek,

    I think I'll write a small program to test the behaviour.

    Kind regards,

    Rainer

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.