diff --git a/vala/hello/thread.vala b/vala/hello/thread.vala new file mode 100644 index 0000000..9f81b61 --- /dev/null +++ b/vala/hello/thread.vala @@ -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 ( thread_fun, false ); + } + catch( ThreadError ex ) + { + return -1; + } + return 0; + } +}