1 ! Copyright (C) 2009 Phil Dawes.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien.c-types alien.strings alien.syntax io
4 io.encodings.utf8 io.files kernel sequences system threads
8 FUNCTION: void* start_standalone_factor_in_new_thread ( int argc, c-string* argv ) ;
10 : start-vm-in-os-thread ( args -- threadhandle )
12 [ length ] [ native-string-encoding strings>alien ] bi
13 start_standalone_factor_in_new_thread ;
15 : start-tetris-in-os-thread ( -- )
16 { "-run=tetris" } start-vm-in-os-thread drop ;
18 : start-test-thread-in-os-thread ( -- )
19 { "-run=native-thread-test" } start-vm-in-os-thread drop ;
22 "/tmp/hello" utf8 [ "hello!\n" write ] with-file-appender 5000000 sleep ;