[Vala] Thread Support



I'm using Vala 0.20.

I have an async function called directly in my code. When compiles I get
this:

XXXXXXX: warning: implicit .begin is deprecated

But when try this code:

Thread<void> th = new Thread<void>.try ("loading scl", () => {
            async_function (); /*Asinc function */
            return null;
          });
th.join ();

Error message is:

XXXXX: error: The name `try' does not exist in the context of `GLib.Thread'

I've checked glib-2.0.vapi, for both vala-0.20 and 0.22, that function is
present just for GLIB_2_32, checking my installed version I have a 2.40 on
a GNOME Ubuntu 14.04 box.

Then I don't find why this function is not present for the compiler, and
get warnings when try to use Thread<T>.create function.

Tutorials at Vala documentation is not too useful. If found usable your
comments, I can update that documenation for GLib 2.32 and above. Please
help me to improve that documentation.

-- 
Trabajar, la mejor arma para tu superación
"de grano en grano, se hace la arena" (R) (en trámite, pero para los
cuates: LIBRE)


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