Vala: hello.vala
This commit is contained in:
parent
1a6b9cdab6
commit
d280a6a024
|
@ -0,0 +1,26 @@
|
|||
using GLib;
|
||||
public class MyThread : GLib.Object
|
||||
{
|
||||
public static void * thread_fun()
|
||||
{
|
||||
stdout.printf( "Поток активизирован... \n" );
|
||||
return null;
|
||||
}
|
||||
public static int main( string [] args )
|
||||
{
|
||||
if( !Thread.supported() )
|
||||
{
|
||||
stdout.printf( "Без поддержки потоков выполнение невозможно \n" );
|
||||
return -1;
|
||||
}
|
||||
try
|
||||
{
|
||||
Thread.create <void *>( thread_fun, false );
|
||||
}
|
||||
catch( ThreadError ex )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue