The mutex is twice locked in different threads
The mutex is twice locked in different threads
- Subject: The mutex is twice locked in different threads
- From: Eugene Karpov <email@hidden>
- Date: Thu, 16 Jul 2009 18:50:15 +0400
Brothers,
Our application often use posix mutex for synchronization. Sometimes we are looking problem with sync access to protected data. After investigation of darwin source and inserting trace messages we detected problem with double locking of mutex in different threads.
Initialization:
pthread_mutex_init(&m_mutex, NULL)
Locking trace:
corrected locking about 7030 times
PreLock thread(1817c00) id(sync_report_9AC72CBD) owner(0) lock_count(0)
Lock thread(1817c00) id(sync_report_9AC72CBD) owner(1817c00) lock_count(1) error(0)
PreUnlock thread(1817c00) id(sync_report_9AC72CBD) owner(1817c00) lock_count(1)
Unlock thread(1817c00) id(sync_report_9AC72CBD) owner(0) lock_count(0) error(0)
-----------
double locking
PreLock thread(1822400) id(sync_report_9AC72CBD) owner(0) lock_count(0)
Lock thread(1822400) id(sync_report_9AC72CBD) owner(1822400) lock_count(1) error(0)
PreLock thread(181be00) id(sync_report_9AC72CBD) owner(1822400) lock_count(1)
Lock thread(181be00) id(sync_report_9AC72CBD) owner(181be00) lock_count(1) error(0)
PreUnlock thread(1822400) id(sync_report_9AC72CBD) owner(181be00) lock_count(1)
Unlock thread(1822400) id(sync_report_9AC72CBD) owner(181be00) lock_count(1) error(1)
thread - executable thread
id - mutex id
owner, lock_count - protected members of mutex
error - result
Why it is happing?
Darwin 8.11.1
Mac OS 10.4.11
Intel Core 2 Duo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden