Re: [Tracker] strange bugs and test script



Good intuition man, that seems to have fixed it :-) Just removing that
second block does the trick. I've attached a patch if you're too lazy
to do it yourself :-P Thanks alot!

Samuel

On 9/15/06, Jamie McCracken <jamiemcc blueyonder co uk> wrote:
Samuel Cormier-Iijima wrote:
> can you also try running it a couple of times, maybe in quick
> succession? on my (slower) laptop, the client will freeze quite often
> while getting File.Name for the files...
>

yes I can replicate that :)

Im about to go out but I think I have it:

in tracker-utils.c

tracker_notify_request_data_available (void)
{
        /* if thread is asleep then we just need to wake it up! */
        if (g_mutex_trylock (tracker->request_signal_mutex)) {
                g_cond_signal (tracker->request_thread_signal);
                g_mutex_unlock (tracker->request_signal_mutex);
                return;
        }

        /* if busy - check if async queue has new stuff as we do not need to
notify then */
        if (g_async_queue_length (tracker->user_request_queue) > 0) {
                return;
        }



the g_async_queue_length (tracker->user_request_queue) > 0 will always
be true because we call notify after pushing the data on to the queue so
the race condition will be there.

The solution should be to either remove that if block or test for > 1 so
the rest of the function can execute and prevent the race.

--
Mr Jamie McCracken
http://jamiemcc.livejournal.com/

Attachment: race-fix.patch
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]