qom/object.c How about using G_LOCK ? thread safety
PATCH 1/1 qom/object.c How about using G_LOCK ? thread safety
Signed-off-by zhuguanghong <[email protected]>
--- qom/object.c | 4 ++++ 1 file changed, 4 insertions(+)
qom/object.c +4 -0
@@ -73,15 +73,19 @@ struct TypeImpl };static Type type_interface; +G_LOCK_DEFINE (GHashTable_mutex);static GHashTable *type_table_get (void ) {static GHashTable *type_table; +G_LOCK ( GHashTable_mutex);if (type_table ==NULL ) { type_table =g_hash_table_new (g_str_hash, g_str_equal); } +G_UNLOCK ( GHashTable_mutex); +return type_table; }
Signature · 1 line
2.20.1