1 /* 2 * Adds a mutex implementation based on c++ mutex to harfbuzz. 3 */ 4 #include <mutex> 5 6 using hb_mutex_impl_t = std::mutex; 7 #define HB_MUTEX_IMPL_INIT UNUSED 8 #define hb_mutex_impl_init(M) HB_STMT_START { new (M) hb_mutex_impl_t; } HB_STMT_END 9 #define hb_mutex_impl_lock(M) (M)->lock () 10 #define hb_mutex_impl_unlock(M) (M)->unlock () 11 #define hb_mutex_impl_finish(M) HB_STMT_START { (M)->~hb_mutex_impl_t(); } HB_STMT_END 12