27 lines
546 B
Vala
27 lines
546 B
Vala
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;
|
|
}
|
|
}
|