#include <stdio.h>
#include <prex/prex.h>
void child_thread(void)
{
    printf("Child thread!\n");
    thread_terminate(thread_self());
}
static char stack[1024];
int main(int argc, char *argv[])
{
    thread_t child;     
    if (thread_create(task_self(), &child) != 0)
        return -1;
    if (thread_load(child, child_thread, stack) != 0)
        return -1;
    if (thread_resume(child) != 0)
        return -1;

    thread_setprio(thread_self(), 254); 
    printf("Parent thread!\n");
    return 0;
}

When I run example code about (on vmware server 1.0.4 virtual machine
with prex-0.7), it's said: "Oops! it's kernel mode now!!!".

Regards,
VTB

PS: program "sample/thread" run as normally except didn't return to
cmdbox prompt :)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Prex-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/prex-devel

Reply via email to