@@ -35,7 +35,7 @@ Created 2013-03-26 Sunny Bains.
35
35
#include " sync0arr.h"
36
36
37
37
/* * OS mutex for tracking lock/unlock for debugging */
38
- template <template <typename > class Policy = NoPolicy >
38
+ template <template <typename > class Policy >
39
39
struct OSTrackMutex {
40
40
41
41
typedef Policy<OSTrackMutex> MutexPolicy;
@@ -152,7 +152,7 @@ struct OSTrackMutex {
152
152
#include < sys/syscall.h>
153
153
154
154
/* * Mutex implementation that used the Linux futex. */
155
- template <template <typename > class Policy = NoPolicy >
155
+ template <template <typename > class Policy >
156
156
struct TTASFutexMutex {
157
157
158
158
typedef Policy<TTASFutexMutex> MutexPolicy;
@@ -264,7 +264,7 @@ struct TTASFutexMutex {
264
264
265
265
#endif /* HAVE_IB_LINUX_FUTEX */
266
266
267
- template <template <typename > class Policy = NoPolicy >
267
+ template <template <typename > class Policy >
268
268
struct TTASMutex {
269
269
270
270
typedef Policy<TTASMutex> MutexPolicy;
@@ -364,7 +364,7 @@ struct TTASMutex {
364
364
std::atomic<uint32_t > m_lock_word;
365
365
};
366
366
367
- template <template <typename > class Policy = NoPolicy >
367
+ template <template <typename > class Policy >
368
368
struct TTASEventMutex {
369
369
370
370
typedef Policy<TTASEventMutex> MutexPolicy;
@@ -534,7 +534,6 @@ with the Performance Schema instrumentation. */
534
534
template <typename MutexImpl>
535
535
struct PolicyMutex
536
536
{
537
- typedef MutexImpl MutexType;
538
537
typedef typename MutexImpl::MutexPolicy Policy;
539
538
540
539
PolicyMutex () UNIV_NOTHROW : m_impl()
@@ -565,7 +564,7 @@ struct PolicyMutex
565
564
pfs_exit ();
566
565
#endif /* UNIV_PFS_MUTEX */
567
566
568
- policy ().release (m_impl);
567
+ ut_d ( policy ().context . release (m_impl) );
569
568
570
569
m_impl.exit ();
571
570
}
@@ -591,11 +590,11 @@ struct PolicyMutex
591
590
locker = pfs_begin_lock (&state, name, line);
592
591
#endif /* UNIV_PFS_MUTEX */
593
592
594
- policy ().enter (m_impl, name, line);
593
+ ut_d ( policy ().context . enter (m_impl, name, line) );
595
594
596
595
m_impl.enter (n_spins, n_delay, name, line);
597
596
598
- policy ().locked (m_impl, name, line);
597
+ ut_d ( policy ().context . locked (m_impl, name, line) );
599
598
#ifdef UNIV_PFS_MUTEX
600
599
pfs_end (locker, 0 );
601
600
#endif /* UNIV_PFS_MUTEX */
@@ -624,9 +623,9 @@ struct PolicyMutex
624
623
625
624
if (ret == 0 ) {
626
625
627
- policy ().enter (m_impl, name, line);
626
+ ut_d ( policy ().context . enter (m_impl, name, line) );
628
627
629
- policy ().locked (m_impl, name, line);
628
+ ut_d ( policy ().context . locked (m_impl, name, line) );
630
629
}
631
630
632
631
#ifdef UNIV_PFS_MUTEX
@@ -640,7 +639,7 @@ struct PolicyMutex
640
639
/* * @return true if the thread owns the mutex. */
641
640
bool is_owned () const UNIV_NOTHROW
642
641
{
643
- return (policy ().is_owned ());
642
+ return (policy ().context . is_owned ());
644
643
}
645
644
#endif /* UNIV_DEBUG */
646
645
@@ -662,6 +661,7 @@ struct PolicyMutex
662
661
663
662
m_impl.init (id, filename, line);
664
663
policy ().init (m_impl, id, filename, line);
664
+ ut_d (policy ().context .init (id));
665
665
}
666
666
667
667
/* * Free resources (if any) */
@@ -672,6 +672,7 @@ struct PolicyMutex
672
672
#endif /* UNIV_PFS_MUTEX */
673
673
m_impl.destroy ();
674
674
policy ().destroy ();
675
+ ut_d (policy ().context .destroy ());
675
676
}
676
677
677
678
/* * Required for os_event_t */
0 commit comments