On Wed, 8 Nov 2023 09:53:22 +0100 Pierre Couderc via enlightenment-users
<enlightenment-users@lists.sourceforge.net> said:

> Is there a topic to introduce efl under C++.
> 
> I have  a problem with "hello world" in Unified C API
> 
> If I compile 
> https://www.enlightenment.org/develop/tutorials/c/hello-world-gui.md 
> with C++ (linux), all is fine.
> 
> Il I had a thread, it fails with nothing displayed  :
> 
> void start()
> {
> 
>      while(1)
>      {
>          sleep(1);
>      }
>      return;
> }
> //******************************************************  main 
> *******************************************************
> EAPI_MAIN void
> efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
> {
>      _gui_setup();
>      thread wait(start);

^^^ this here blocks. the main loop can't run and proc ess events, flush
buffers etc. all gui toolkits need to do this to work. efl, gtk, qt, ... it's
standard. they have a main loop to do all of this processing and you should
never block it.

this above is spawning a thread then waiting for it to exit (it never does)
then below the join i assume is like pthread_join and it "frees" the thread.

efl has plenty of thread handling api's to do a lot of thread stuff cleanly
including messaging back to the main loop - automatically joining threads
invisibly for you and not blocking.

>      wait.join();
> 
> }
> EFL_MAIN()
> 
> Thanks.
> 
> PC
> 
> 
> 
> _______________________________________________
> enlightenment-users mailing list
> enlightenment-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-users


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
Carsten Haitzler - ras...@rasterman.com



_______________________________________________
enlightenment-users mailing list
enlightenment-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-users

Reply via email to