]> mj.ucw.cz Git - libucw.git/commitdiff
Trans: trans_open_rp() removed
authorMartin Mares <mj@ucw.cz>
Sun, 17 Apr 2011 15:16:38 +0000 (17:16 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 17 Apr 2011 15:16:38 +0000 (17:16 +0200)
It did never make much sense, since the resource pool is automatically
destroyed when the transaction is over.

ucw/trans.c
ucw/trans.h

index a58d7d166b7e1cac8407766d048d2229772fda2b..fffcf7503d03c7431aeb5286c08d297cb39fbc78 100644 (file)
@@ -41,7 +41,7 @@ trans_cleanup(void)
 }
 
 struct trans *
-trans_open_rp(struct respool *rp)
+trans_open(void)
 {
   trans_init();
   struct ucwlib_context *c = ucwlib_thread_context();
@@ -51,8 +51,7 @@ trans_open_rp(struct respool *rp)
   struct trans *t = mp_alloc(mp, sizeof(*t));
   t->trans_pool_state = mst;
 
-  if (!rp)
-    rp = rp_new("trans", mp);
+  struct respool *rp = rp_new("trans", mp);
   t->rpool = rp;
   t->prev_rpool = rp_switch(rp);
 
index 95d9ce116700456fde15ee645d46b1322a509e8b..3b7220f791c62d7c313450707bec0d7217958ced 100644 (file)
@@ -27,11 +27,7 @@ struct trans {
 void trans_init(void);         // Called automatically on trans_open() if needed
 void trans_cleanup(void);      // Free memory occupied by the transaction system pools
 
-struct trans *trans_open_rp(struct respool *rp);
-static inline struct trans *trans_open(void)
-{
-  return trans_open_rp(NULL);
-}
+struct trans *trans_open(void);
 struct trans *trans_get_current(void);
 void trans_commit(void);
 void trans_rollback(void);