Hi,
 
In a very simple test program I have created, I get a memory fault when I try to do a pth_join on SCO OpenServer 5.0.5, but it works fine on HPUX 10.20. Ideas? Should I reinstall pth perhaps? Source follows.
The actual output is:
In main
Before join
Memory fault(coredump)
 
Thanks.
 
-- Lachlan Holmes
   Software Engineer
   TODAY Systems, Inc.
   www.todaysystems.com.au
 
 
#include <stdio.h>
#include <pth.h>
#include <stdlib.h>
 
void *clientThread(void *param);
 
int
main() {
    pth_t       hThread;
    int         value = 0;
    int         *valuePtr;
    valuePtr = (int *)malloc(sizeof(int));
    if (valuePtr == NULL) {
        perror("malloc return");
        exit(1);
    }
    valuePtr = &value;
 
    if (pth_init() == FALSE) {
        perror("pth_init returned");
        exit(1);
    }
 
    printf("In main\n");
 
    if (pth_spawn(PTH_ATTR_DEFAULT, clientThread, 0) == NULL) {
        perror("pth_spawn returned");
        exit(1);
    }
 
    printf("Before join\n");
 
    if (pth_join(hThread, (void **)&valuePtr) == FALSE) {
        perror("pth_join returned");
        exit(1);
    }
 
    printf("In main, after pth ran.\n");
 
    if (pth_kill() == FALSE) {
        perror("pth_kill returned");
        exit(1);
    }
    return 0;
}
 
void *
clientThread(void *param) {
    printf("In thread\n");
    return 0;
}

Reply via email to