ソースを参照

Remove hdb constructor usage.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2275 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 16 年 前
コミット
32ff97b87b
2 ファイル変更4 行追加20 行削除
  1. 2 18
      include/corosync/hdb.h
  2. 2 2
      lcr/lcr_ifact.c

+ 2 - 18
include/corosync/hdb.h

@@ -125,24 +125,8 @@ static struct hdb_handle_database (database_name) = {			\
 	.handles 	= NULL,						\
 	.iterator	= 0,						\
 	.destructor	= destructor_function,				\
-	.first_run	= 0						\
+	.first_run	= 1						\
 };									\
-static void database_name##_init(void)__attribute__((constructor));	\
-static void database_name##_init(void)					\
-{                                                                       \
-	hdb_database_lock_init (&(database_name).lock);		\
-}
-
-#define DECLARE_HDB_DATABASE_FIRSTRUN(database_name)			\
-static struct hdb_handle_database (database_name) = {			\
-	.first_run = 1, 						\
-};									\
-static void database_name##_init(void)__attribute__((constructor));	\
-static void database_name##_init(void)					\
-{                                                                       \
-	memset (&(database_name), 0, sizeof (struct hdb_handle_database));\
-	hdb_database_lock_init (&(database_name).lock);		\
-}
 
 static inline void hdb_create (
 	struct hdb_handle_database *handle_database)
@@ -173,7 +157,7 @@ static inline int hdb_handle_create (
 	int i;
 
 	if (handle_database->first_run == 1) {
-		memset (handle_database, 0, sizeof (struct hdb_handle_database));
+		handle_database->first_run = 0;
 		hdb_database_lock_init (&handle_database->lock);
 	}
 	hdb_database_lock (&handle_database->lock);

+ 2 - 2
lcr/lcr_ifact.c

@@ -61,9 +61,9 @@ struct lcr_iface_instance {
 	void (*destructor) (void *context);
 };
 
-DECLARE_HDB_DATABASE_FIRSTRUN (lcr_component_instance_database);
+DECLARE_HDB_DATABASE (lcr_component_instance_database, NULL);
 
-DECLARE_HDB_DATABASE_FIRSTRUN (lcr_iface_instance_database);
+DECLARE_HDB_DATABASE (lcr_iface_instance_database, NULL);
 
 /*
 static struct hdb_handle_database lcr_component_instance_database = {