struct mysql_mutex_t { /** The real mutex. */ my_mutex_t m_mutex; /** The instrumentation hook. Note that this hook is not conditionally defined, for binary compatibility of the @c mysql_mutex_t interface. */ struct PSI_mutex *m_psi{nullptr}; };
typedef pthread_mutex_t native_mutex_t;
struct my_mutex_t { union u { native_mutex_t m_native; safe_mutex_t *m_safe_ptr; // 当在非linux下就使用safe_mutex_t, 同时会打开宏SAFE_MUTEX } m_u; }; typedef struct my_mutex_t my_mutex_t;
struct PSI_mutex_info_v1 { /** Pointer to the key assigned to the registered mutex. */ PSI_mutex_key *m_key; /** The name of the mutex to register. */ const char *m_name; /** The flags of the mutex to register. @sa PSI_FLAG_SINGLETON */ unsigned int m_flags; /** Volatility index. */ int m_volatility; /** Documentation. */ const char *m_documentation; }; typedef PSI_mutex_info_v1 PSI_mutex_info;
struct mysql_cond_t { /** The real condition */ native_cond_t m_cond; /** The instrumentation hook. Note that this hook is not conditionally defined, for binary compatibility of the @c mysql_cond_t interface. */ struct PSI_cond *m_psi; };
switch (Connection_handler_manager::thread_handling) { case SCHEDULER_ONE_THREAD_PER_CONNECTION: connection_handler = new (std::nothrow) Per_thread_connection_handler(); break; case SCHEDULER_NO_THREADS: connection_handler = new (std::nothrow) One_thread_connection_handler();