I am using pth 1.4.0 in Sco 5.0.4 openserver and the program is abnormally terminating.I am including my sample program and the error output.
******* PROGRAM **************************** #include <iostream.h> #include <unistd.h> #include <stdlib.h> #include <pthread.h> #include <pth.h> void *func1(void * args); pthread_mutex_t *mut; pthread_cond_t *cond; int main() { cout<<"main start running"<<endl; pth_init(); pthread_t t1,t2; mut = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); pthread_mutex_init (mut, NULL); cond = (pthread_cond_t *) malloc (sizeof (pthread_cond_t)); pthread_cond_init (cond, NULL); pthread_create (&t1, NULL,&func1, NULL); pthread_join (t1, NULL); cout<<"main end running"<<endl; } void *func1(void * args) { cout<<"inside start func1"<<endl; cout<<"end **func1"<<endl; return (NULL); } *********************** ERROR OUTPUT ********************** 20601:pth_lib.c:0058: pth_init: enter 20601:pth_lib.c:0192: pth_spawn: enter 20601:pth_mctx.c:0247: pth_mctx_set: enter 20601:pth_mctx.c:0391: pth_mctx_set_trampoline: return to caller 20601:pth_mctx.c:0395: pth_mctx_set_trampoline: reentered from caller 20601:pth_mctx.c:0433: pth_mctx_set_trampoline_jumpin: switch back to caller ==== THREAD CONTEXT SWITCH =========================================== 20601:pth_mctx.c:0363: pth_mctx_set: leave 20601:pth_lib.c:0281: pth_spawn: leave 20601:pth_lib.c:0192: pth_spawn: enter 20601:pth_lib.c:0281: pth_spawn: leave ==== THREAD CONTEXT SWITCH =========================================== 20601:pth_mctx.c:0440: pth_mctx_set_trampoline_jumpin: reentered from scheduler 20601:pth_sched.c:0165: pth_scheduler: bootstrapping 20601:pth_sched.c:0189: pth_scheduler: new thread "main" moved to top of ready queue 20601:pth_sched.c:0206: pth_scheduler: thread "main" selected (prio=0, qprio=0) 20601:pth_sched.c:0231: pth_scheduler: switching to thread 0x80a33ec ("main") ==== THREAD CONTEXT SWITCH =========================================== 20601:pth_lib.c:0108: pth_init: leave 20601:pth_lib.c:0054: return 0x0 with errno 1("Operation not permitted") 20601:pth_lib.c:0192: pth_spawn: enter 20601:pth_mctx.c:0247: pth_mctx_set: enter 20601:pth_mctx.c:0391: pth_mctx_set_trampoline: return to caller 20601:pth_mctx.c:0395: pth_mctx_set_trampoline: reentered from caller 20601:pth_mctx.c:0433: pth_mctx_set_trampoline_jumpin: switch back to caller ==== THREAD CONTEXT SWITCH =========================================== 20601:pth_mctx.c:0363: pth_mctx_set: leave 20601:pth_lib.c:0281: pth_spawn: leave 20601:pth_lib.c:0415: pth_join: joining thread "main.child@1008895627=0x80a33ec" 20601:pth_event.c:0388: pth_wait: enter from thread "main" 20601:pth_event.c:0394: pth_wait: waiting on event 0x8093114 20601:pth_lib.c:0444: pth_yield: enter from thread "main" 20601:pth_lib.c:0466: pth_yield: give up control to scheduler ==== THREAD CONTEXT SWITCH =========================================== 20601:pth_sched.c:0247: pth_scheduler: cameback from thread 0x80a33ec ("main") 20601:pth_sched.c:0256: pth_scheduler: thread "main" ran 0.100000 20601:pth_sched.c:0338: pth_scheduler: moving thread "main" to waiting queue 20601:pth_sched.c:0399: pth_sched_eventmanager: enter in polling mode 20601:pth_sched.c:0771: pth_sched_eventmanager: leaving 20601:pth_sched.c:0189: pth_scheduler: new thread "main.child@1008895627=0x80a33ec" moved to top of ready queue 20601:pth_sched.c:0206: pth_scheduler: thread "main.child@1008895627=0x80a33ec" selected (prio=0, qprio=0) 20601:pth_sched.c:0231: pth_scheduler: switching to thread 0x80a37ac ("main.child@1008895627=0x80a33 ec") ==== THREAD CONTEXT SWITCH =========================================== 20601:pth_mctx.c:0440: pth_mctx_set_trampoline_jumpin: reentered from scheduler 20601:pth_lib.c:0370: pth_exit: marking thread "main.child@1008895627=0x80a33ec" as dead 20601:pth_lib.c:0394: pth_exit: switching from thread "main.child@1008895627=0x80a33ec" to scheduler ==== THREAD CONTEXT SWITCH =========================================== 20601:pth_sched.c:0247: pth_scheduler: cameback from thread 0x80a37ac ("main.child@1008895627=0x80a33ec") 20601:pth_sched.c:0256: pth_scheduler: thread "main.child@1008895627=0x80a33ec" ran 0.000000 20601:pth_sched.c:0325: pth_scheduler: marking thread "main.child@1008895627=0x80a33ec" as dead 20601:pth_sched.c:0399: pth_sched_eventmanager: enter in waiting mode 20601:pth_sched.c:0560: pth_sched_eventmanager: [non-I/O] event occurred for thread "main" 20601:pth_sched.c:0760: pth_sched_eventmanager: thread "main" moved from waiting to ready queue 20601:pth_sched.c:0771: pth_sched_eventmanager: leaving 20601:pth_sched.c:0206: pth_scheduler: thread "main" selected (prio=0, qprio=0) 20601:pth_sched.c:0231: pth_scheduler: switching to thread 0x80a33ec ("main") ==== THREAD CONTEXT SWITCH =========================================== 20601:pth_lib.c:0468: pth_yield: got back control from scheduler 20601:pth_lib.c:0470: pth_yield: leave to thread "main" 20601:pth_event.c:0417: pth_wait: occurred event 0x8093114 20601:pth_event.c:0422: pth_wait: leave to thread "main" 20601:pth_lib.c:0117: pth_kill: enter 20601:pth_lib.c:0123: pth_kill: leav ______________________________________________________________________ GNU Portable Threads (Pth) http://www.gnu.org/software/pth/ User Support Mailing List [EMAIL PROTECTED] Automated List Manager (Majordomo) [EMAIL PROTECTED]