This is the mail archive of the
pthreads-win32@sources.redhat.com
mailing list for the pthreas-win32 project.
problems with pthread_mutex_lock()
- From: "martines" <martiness1 at poczta dot onet dot pl>
- To: <pthreads-win32 at sources dot redhat dot com>
- Date: Mon, 22 Sep 2003 18:56:41 +0200
- Subject: problems with pthread_mutex_lock()
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