test_create.c
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:1k
- /* ==== test_create.c ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Test pthread_create() and pthread_exit() calls.
- *
- * 1.00 93/08/03 proven
- * -Started coding this file.
- */
- #define PTHREAD_KERNEL
- #include <pthread.h>
- #include <stdio.h>
- void* new_thread(void* arg)
- {
- int i;
- printf("New thread was passed arg address %xn", arg);
- printf("New thread stack at %xn", &i);
- return(NULL);
- PANIC();
- }
- main()
- {
- pthread_t thread;
- int i;
- printf("Original thread stack at %xn", &i);
- if (pthread_create(&thread, NULL, new_thread, (void *)0xdeadbeef)) {
- printf("Error: creating new threadn");
- }
- pthread_exit(NULL);
- PANIC();
- }