[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KIO::listDir() freezes in multi-threaded KioFuse due to timer
From:       Thiago Macieira <thiago () kde ! org>
Date:       2007-10-29 8:18:03
Message-ID: 200710290918.09767.thiago () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Em Monday 29 October 2007 03:34:49 Vlad Codrea escreveu:
> --- Thiago Macieira <thiago@kde.org> wrote:
> > Vlad Codrea wrote:
> > >KioFuse freezes and gives the following warning when Fuse is
> >
> > allowed
> >
> > >to create a separate thread for every filesystem operation. The
> >
> > first
> >
> > >readdir() attempt succeeds, but the freeze and warning appear
> > >consistently on the second readdir() attempt:
> >
> > Solution: use KIO from the GUI thread only.
>
> I've taken your advice and created the ListJob instance in the main
> thread, specifically in the slot KioFuseApp::listJobMainThread(). I
> verified that the instance of KioFuseApp belongs to the main thread by
> running:
>
> kDebug()<<"this->thread()"<<this->thread()<<endl;
>
> Strangely though, the ListJob instance that is created in the slot
> KioFuseApp::listJobMainThread() belongs to the FUSE thread! Again, I
> verified this by running:
>
> kDebug()<<"listJob->thread()"<<listJob->thread()<<endl;
>
> Could this be because I'm connecting from the FUSE thread to the slot
> KioFuseApp::listJobMainThread() using Qt::DirectConnection? I tried
> using Qt::QueuedConnection but the slot never seems to get executed.

this->thread() return this's owning thread. It doesn't mean you're running in 
it! Check QThread::currentThread().

You probably have a direct connection to your slot, so it got called in the 
wrong thread.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

["signature.asc" (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic