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 alien.utilities
4 io io.encodings.utf8 io.files kernel sequences system threads ;
7 FUNCTION: void* start_standalone_factor_in_new_thread ( int argc, c-string* argv )
9 : start-vm-in-os-thread ( args -- threadhandle )
11 [ length ] [ native-string-encoding strings>alien ] bi
12 start_standalone_factor_in_new_thread ;
14 : start-tetris-in-os-thread ( -- )
15 { "-run=tetris" } start-vm-in-os-thread drop ;
17 : start-test-thread-in-os-thread ( -- )
18 { "-run=native-thread-test" } start-vm-in-os-thread drop ;
21 "/tmp/hello" utf8 [ "hello!\n" write ] with-file-appender 5000000 sleep ;