@@ -28,11 +28,11 @@ MachThread::MachThread(MachProcess *process, bool is_64_bit,
28
28
uint64_t unique_thread_id, thread_t mach_port_num)
29
29
: m_process(process), m_unique_id(unique_thread_id),
30
30
m_mach_port_number(mach_port_num), m_seq_id(GetSequenceID()),
31
- m_state(eStateUnloaded), m_state_mutex(PTHREAD_MUTEX_RECURSIVE ),
32
- m_suspend_count( 0 ), m_stop_exception( ),
33
- m_arch_up(DNBArchProtocol::Create( this )), m_reg_sets( NULL ),
34
- m_num_reg_sets( 0 ), m_extended_info(), m_dispatch_queue_name( ),
35
- m_is_64_bit(is_64_bit), m_pthread_qos_class_decode(nullptr ) {
31
+ m_state(eStateUnloaded), m_state_mutex(), m_suspend_count( 0 ),
32
+ m_stop_exception( ), m_arch_up(DNBArchProtocol::Create( this ) ),
33
+ m_reg_sets( NULL ), m_num_reg_sets( 0 ), m_extended_info( ),
34
+ m_dispatch_queue_name( ), m_is_64_bit(is_64_bit ),
35
+ m_pthread_qos_class_decode(nullptr ) {
36
36
nub_size_t num_reg_sets = 0 ;
37
37
m_reg_sets = m_arch_up->GetRegisterSetInfo (&num_reg_sets);
38
38
m_num_reg_sets = num_reg_sets;
@@ -469,13 +469,12 @@ bool MachThread::NotifyException(MachException::Data &exc) {
469
469
}
470
470
471
471
nub_state_t MachThread::GetState () {
472
- // If any other threads access this we will need a mutex for it
473
- PTHREAD_MUTEX_LOCKER (locker, m_state_mutex);
472
+ std::lock_guard<std::recursive_mutex> guard (m_state_mutex);
474
473
return m_state;
475
474
}
476
475
477
476
void MachThread::SetState (nub_state_t state) {
478
- PTHREAD_MUTEX_LOCKER (locker, m_state_mutex);
477
+ std::lock_guard<std::recursive_mutex> guard ( m_state_mutex);
479
478
m_state = state;
480
479
DNBLogThreadedIf (LOG_THREAD,
481
480
" MachThread::SetState ( %s ) for tid = 0x%8.8" PRIx64 " " ,
0 commit comments