List Info

Thread: hildon date editor & threads




hildon date editor & threads
user name
2006-04-25 08:06:04
Hi all,

I have encountered a situation where HildonCalendarPopup
(created by
regular HildonDateEditor) locks up when selecting date from
it. This
occurs only if gdk_threads are enabled.

A modified tutorial example code to demonstrate the problem:
/* Includes */
#include <hildon-widgets/hildon-app.h>
#include <gtk/gtk.h> 
#include <gtk/gtkbutton.h>


int main( int argc, char* argv[] )
{
    /* Create needed variables */
    HildonApp *app; 
    HildonAppView *main_view;
    GtkWidget *date_editor;

    g_thread_init (NULL);
    gdk_threads_init ();
    gdk_threads_enter ();

    /* Initialize the GTK. */
    gtk_init( &argc, &argv );

    /* Create the hildon application and setup the title */
    app = HILDON_APP( hildon_app_new() );
    hildon_app_set_title( app, ("Hello maemo!"
));
    main_view = HILDON_APPVIEW(hildon_appview_new(NULL));

    /* Create button and add it to main view */
    date_editor = hildon_date_editor_new ();
    gtk_container_add(GTK_CONTAINER(main_view),
                      date_editor);

    /* Set application view */
    hildon_app_set_appview( app, main_view );
        
    /* Begin the main application */
    gtk_widget_show_all( GTK_WIDGET( app ) );
    gtk_main();

    gdk_threads_leave ();
    
    /* Exit */
    return 0;
}

Have anyone else encountered this behaviour?


Cheers,

Petri Liimatta



_______________________________________________
maemo-developers mailing list
maemo-developersmaemo.org
h
ttps://maemo.org/mailman/listinfo/maemo-developers
hildon date editor & threads
user name
2006-04-25 09:22:39
On Tue, 2006-04-25 at 11:06 +0300, ext Petri Liimatta wrote:
> Hi all,
> 
> I have encountered a situation where
HildonCalendarPopup (created by
> regular HildonDateEditor) locks up when selecting date
from it. This
> occurs only if gdk_threads are enabled.

We've spotted some thread safety problems in hildon and gtk
modifications. I think this one was recently fixed in
https://stage.maemo.org/viewcvs.cgi/maemo?rev=376
7&view=rev

(Unfortunately it's only for the upcoming maemo 2.0...)


-- 
Tommi Komulainen                           
<tommi.komulainennokia.com>

_______________________________________________
maemo-developers mailing list
maemo-developersmaemo.org
h
ttps://maemo.org/mailman/listinfo/maemo-developers
hildon date editor & threads
user name
2006-04-25 10:48:05
On Tue, 2006-04-25 at 11:06, ext Petri Liimatta wrote:
...
>     gdk_threads_enter ();
...
>     gdk_threads_leave ();

Isn't this because of this? You keep the thread mutex all
the time.

BR; Kimmo

> Have anyone else encountered this behaviour?
> 
> 
> Cheers,
> 
> Petri Liimatta
> 
> 
> 
> _______________________________________________
> maemo-developers mailing list
> maemo-developersmaemo.org
> h
ttps://maemo.org/mailman/listinfo/maemo-developers
_______________________________________________
maemo-developers mailing list
maemo-developersmaemo.org
h
ttps://maemo.org/mailman/listinfo/maemo-developers
hildon date editor & threads
user name
2006-04-25 15:19:40
On Tue, 2006-04-25 at 13:48 +0300, Kimmo Hämäläinen wrote:
> On Tue, 2006-04-25 at 11:06, ext Petri Liimatta wrote:
> ...
> >     gdk_threads_enter ();
> ...
> >     gdk_threads_leave ();
> 
> Isn't this because of this? You keep the thread mutex
all the time.

No, it doesen't change anything even if you leave them out.
I took the
thread part for my example from gdk reference manual
"A minimal main
program for a threaded GTK+ application". My program
actually doesen't
have mutex locked all the time, but date editor behaviour is
exactly the
same.


Cheers,

Pete

> BR; Kimmo
> 
> > Have anyone else encountered this behaviour?
> > 
> > 
> > Cheers,
> > 
> > Petri Liimatta
> > 
> > 
> > 
> > _______________________________________________
> > maemo-developers mailing list
> > maemo-developersmaemo.org
> > h
ttps://maemo.org/mailman/listinfo/maemo-developers
_______________________________________________
maemo-developers mailing list
maemo-developersmaemo.org
h
ttps://maemo.org/mailman/listinfo/maemo-developers
hildon date editor & threads
user name
2006-04-25 15:19:40
On Tue, 2006-04-25 at 13:48 +0300, Kimmo Hämäläinen wrote:
> On Tue, 2006-04-25 at 11:06, ext Petri Liimatta wrote:
> ...
> >     gdk_threads_enter ();
> ...
> >     gdk_threads_leave ();
> 
> Isn't this because of this? You keep the thread mutex
all the time.

No, it doesen't change anything even if you leave them out.
I took the
thread part for my example from gdk reference manual
"A minimal main
program for a threaded GTK+ application". My program
actually doesen't
have mutex locked all the time, but date editor behaviour is
exactly the
same.


Cheers,

Pete

> BR; Kimmo
> 
> > Have anyone else encountered this behaviour?
> > 
> > 
> > Cheers,
> > 
> > Petri Liimatta
> > 
> > 
> > 
> > _______________________________________________
> > maemo-developers mailing list
> > maemo-developersmaemo.org
> > h
ttps://maemo.org/mailman/listinfo/maemo-developers
_______________________________________________
maemo-developers mailing list
maemo-developersmaemo.org
h
ttps://maemo.org/mailman/listinfo/maemo-developers
hildon date editor & threads
user name
2006-04-25 15:19:40
On Tue, 2006-04-25 at 13:48 +0300, Kimmo Hämäläinen wrote:
> On Tue, 2006-04-25 at 11:06, ext Petri Liimatta wrote:
> ...
> >     gdk_threads_enter ();
> ...
> >     gdk_threads_leave ();
> 
> Isn't this because of this? You keep the thread mutex
all the time.

No, it doesen't change anything even if you leave them out.
I took the
thread part for my example from gdk reference manual
"A minimal main
program for a threaded GTK+ application". My program
actually doesen't
have mutex locked all the time, but date editor behaviour is
exactly the
same.


Cheers,

Pete

> BR; Kimmo
> 
> > Have anyone else encountered this behaviour?
> > 
> > 
> > Cheers,
> > 
> > Petri Liimatta
> > 
> > 
> > 
> > _______________________________________________
> > maemo-developers mailing list
> > maemo-developersmaemo.org
> > h
ttps://maemo.org/mailman/listinfo/maemo-developers
_______________________________________________
maemo-developers mailing list
maemo-developersmaemo.org
h
ttps://maemo.org/mailman/listinfo/maemo-developers
[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )