This is the mail archive of the
glibc-linux@ricardo.ecn.wfu.edu
mailing list for the glibc project.
Re: Pthread_once() halts at second call
- To: glibc list <glibc-linux at ricardo dot ecn dot wfu dot edu>
- Subject: Re: Pthread_once() halts at second call
- From: "Chongkyoon, Rim" <hermes44 at secsm dot org>
- Date: Wed, 15 Mar 2000 03:18:11 +0900 (KST)
- cc: =?euc-kr?Q?_M=FCller-Tolk=2C_J=F6rg?= <joerg at mueller-tolk dot de>
- Reply-To: glibc-linux at ricardo dot ecn dot wfu dot edu
Although I don't know about pthread, advice you that after freeing a pointer
assign NULL to it. Then before freeing, check whether it's value is NULL. :-)
On Tue, 14 Mar 2000, Joerg Mueller-Tolk wrote:
|Hi All
|
|I have two computers. One running Linux 2.0.36 and glibc-2.0.7, the other one running Linux 2.2.13 and glibc-2.1.3
|
|My program is running quite OK on the first one, just that sometimes two pthreads enter a section protected by a mutex at the same time. This sometimes leads to a double delete[] on the same pointer
|and a segmentation fault. I suppose the problem is that the pthead_mutex_lock() is not atomic. Kaz Kylheku advised me to upgrade to glibc 2.1.3, what I did on my second machine.
|But there the function pthread_once(), working great at the first machine just halts when called the second time.
|
|Has anyone an idea, what to do?
|
|Many thanks
|
|Jörg
|Müller-Tolk
|_________________________________________________________
| ,
| ________/_ Joerg Mueller-Tolk Muehlenweg 10
| _ __ __/ / ,' joerg@mueller-tolk.de 85653 Aying
|_ / / / / /,'__________________________________________
| / / / / /'. Mobile: 0177 8095711 Fax: 08095 2282
| \________/ '. Office: 08102 740-167 Home: 08095 448
|_______________________________may_the_force_be_with_you_
|
|
--
---------------------------------------------------------------
#ifndef _CHONG_KYOON_RIM /* ÀÓÁ¾±Õ's contact point */
#define _CHONG_KYOON_RIM
#define E-mail hermes44@secsm.org, kernel@kldp.org
#define Homepage http://greentea.secsm.org/~hermes44/
#define KernelKorea.org http://kernelkorea.org/
#endif /* _CHONG_KYOON_RIM */
---------------------------------------------------------------