This is the mail archive of the pthreads-win32@sources.redhat.com mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Trouble with mutexes (mutexii?)


Background

I am porting an existing program that makes use of pthreads to NT.
Currently testing under Win2000 5.00.2195 and NT 4.00.1381.

I am using what I believe is the latest version of the pthreads stuff,
pthreads-2000-12-29.exe.  I am building stuff with a mingw32 gcc
cross compiler that I pulled from the mingw32 site.

The program I am porting currently runs correctly under linux
2.2.14-5.0 and a custom build of linux that we have.

Things have gone fairly smoothly, but I am getting the following
behavior and have run out of ideas.

There is one thread that initializes stuff and it does:
    pthread_mutex_lock
    <stuff>
    pthread_mutex_unlock

Two other threads make calls to pthread_mutex_lock awaiting the
completion of the initialization.

Tracing through the code, all 3 pthread_mutex_lock calls are made,
and the pthread_mutex_unlock call is made after the initialization
stuff is done.  The problem I am seeing is that neither of the other
2 waiting threads ever gets past the pthread_mutex_lock call.  They
continue to wait forever.  No error or warning diagnostics are
generated.

I have verified that all threads are successfully created and are
running.

While debugging this, I have noticed that the
pthread_mutex_t->lockCount never changes, it is always 0.  In an
attempt to force a hint out of the system, I have tried manually
setting the lockCount, but my assignements have no effect,
pmt->lockCount is always 0.  This seems bad.

Any ideas or information is greatly appreciated.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]