[
https://issues.apache.org/jira/browse/TS-4952?focusedWorklogId=30399&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-30399
]
ASF GitHub Bot logged work on TS-4952:
--------------------------------------
Author: ASF GitHub Bot
Created on: 11/Oct/16 18:37
Start Date: 11/Oct/16 18:37
Worklog Time Spent: 10m
Work Description: Github user jpeach commented on a diff in the pull
request:
https://github.com/apache/trafficserver/pull/1091#discussion_r82860016
--- Diff: iocore/eventsystem/Thread.cc ---
@@ -44,7 +44,14 @@ Thread::Thread()
{
mutex = new_ProxyMutex();
MUTEX_TAKE_LOCK(mutex, (EThread *)this);
- mutex->nthread_holding = THREAD_MUTEX_THREAD_HOLDING;
+ mutex->nthread_holding += THREAD_MUTEX_THREAD_HOLDING;
+}
+
+Thread::~Thread()
+{
+ ink_release_assert(mutex->thread_holding == (EThread *)this);
+ mutex->nthread_holding -= THREAD_MUTEX_THREAD_HOLDING;
+ MUTEX_UNTAKE_LOCK(mutex, (EThread *)this);
--- End diff --
There is a TSAPI test that creates and destroys threads. Since we now
verify the result of ``pthread_mutex_destroy``, the additional
``n_thread_holding`` refcount causes us to try to destroy the mutex while it is
still locked. We have to drop our bogus refcount to cause the unlock to take
effect.
Issue Time Tracking
-------------------
Worklog Id: (was: 30399)
Time Spent: 1h 20m (was: 1h 10m)
> Improve mutex error checking.
> -----------------------------
>
> Key: TS-4952
> URL: https://issues.apache.org/jira/browse/TS-4952
> Project: Traffic Server
> Issue Type: Bug
> Components: Core
> Reporter: James Peach
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> If any {{ink_mutex}} operations fail, we just abort. Use {{ink_abort}} so
> that we can log an error if this happens.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)