From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15316 invoked by alias); 22 Sep 2003 16:59:51 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 15297 invoked from network); 22 Sep 2003 16:59:48 -0000 Received: from unknown (HELO smtp2.poczta.onet.pl) (213.180.130.30) by sources.redhat.com with SMTP; 22 Sep 2003 16:59:48 -0000 Received: from 174-dzi-1.acn.waw.pl ([62.121.64.174]:16389 "HELO martinezwinxp") by ps2.test.onet.pl with SMTP id ; Mon, 22 Sep 2003 18:56:23 +0200 Message-ID: <001801c3812a$7f872a40$ae40793e@martinezwinxp> From: "martines" To: Subject: problems with pthread_mutex_lock() Date: Mon, 22 Sep 2003 16:59:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-SW-Source: 2003/txt/msg00090.txt.bz2 I'm working on an C++ application and I'm at the stage when I have to choose threads API. Since I want my program to be cross-platform (at least linux and windows) I've decided to use pthreads. Besides I've already used pthreads on linux a bit so I'm more or less familiar with them. I've chosen pthreads-win32 as an pthreads implementation on windows. Unfortunately first call to pthread_mutex_lock() bails out my program (mutex is initilized). At the bottom of this post there is a link to the sources of my application so from now on I'll be referering to source file and line. Failing pthread_mutex_lock() call is at the seeker.cpp:101. I don't yet make any other than mutex initilize/lock/unlock pthreads calls. In particular I don't create any threads. Strange thing is that when lock/unlock call is placed somewhere else in the code (seeker.cpp:45) everything works alright. I've tried using all flavours of pthreadV*.dll-s without success. When running in debug mode after entering pthread_mutex_lock() call it bails out saying: unhandled exception in skr.exe (KERNEL32.DLL): 0xC0000005: Access Violation. I've to mention that the same code compiled on linux with linux pthreads runs there just fine. On windows I've been using VC++6 with SP5. What am I doing wrong? Can anybody please help me? Thank you in advance. My program sources: http://info.wsisiz.edu.pl/~aljawahi/skr.zip Just in case: as of yet there is no output on console. All of the output is written to scanner01.dbg/scanner01.log files best regards, martines