|
|
ru.linux- RU.LINUX --------------------------------------------------------------------- From : yx 2:5020/400 08 Oct 2001 23:23:50 To : Dmitri Bogutski Subject : Re: pthread & HPUX -------------------------------------------------------------------------------- Dmitri Bogutski <diman@tradenet.ee> wrote: > pthread_mutex_lock (&mutex); > c = new Client(); > pthread_mutex_unlock (&mutex); > delete c; [snip] > HPUX-11 / 2CPU will get segfault about 80% runs > at the line 'c=new Client()' > pthread_*() functions return nonzero value to indicate the error, you can check pthread_mutex_lock() return value if a lock by mutex is asquired. Note that with 2CPU machine, maybe, EDEADLK on the mutex by the calling thread. (and maybe, you can also validate the `c' pointer :) > I build it this way: gcc a.cpp -lpthread -DREENTRANT -ggdb > is working under linux. > you may rather use "-D_REENTRANT" under linux, this should be left lots of throubles anyway. > do you have any ideas? > linux is irrelevant to threads. hpux is irrelevant to threads. threads is irrelevant to C++. C++ is irrelevant to programming languages. bye. -- Vladimir Yakovetsky --- ifmail v.2.15dev5 * Origin: yx disorganized groupie (2:5020/400) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.linux/1677a967dadf.html, оценка из 5, голосов 10
|