Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: tml <tarantool-patches@dev.tarantool.org>
Cc: Alexander Turenko <alexander.turenko@tarantool.org>
Subject: [Tarantool-patches] [PATCH 09/22] fiber: use void for empty args
Date: Fri,  3 Jul 2020 17:45:13 +0300	[thread overview]
Message-ID: <20200703144526.522358-10-gorcunov@gmail.com> (raw)
In-Reply-To: <20200703144526.522358-1-gorcunov@gmail.com>

Part-of #4718

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/lib/core/fiber.c         | 18 +++++++++---------
 src/lib/core/fiber.h         | 18 +++++++++---------
 src/lib/core/fiber_channel.c |  2 +-
 src/lib/core/fiber_channel.h |  2 +-
 src/lib/core/fiber_cond.c    |  2 +-
 src/lib/core/fiber_pool.c    |  4 ++--
 6 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/lib/core/fiber.c b/src/lib/core/fiber.c
index 5389ce467..483ae3ce1 100644
--- a/src/lib/core/fiber.c
+++ b/src/lib/core/fiber.c
@@ -303,7 +303,7 @@ fiber_attr_create(struct fiber_attr *fiber_attr)
 }
 
 struct fiber_attr *
-fiber_attr_new()
+fiber_attr_new(void)
 {
 	struct fiber_attr *fiber_attr = malloc(sizeof(*fiber_attr));
 	if (fiber_attr == NULL)  {
@@ -432,7 +432,7 @@ fiber_start(struct fiber *callee, ...)
 }
 
 bool
-fiber_checkstack()
+fiber_checkstack(void)
 {
 	return false;
 }
@@ -551,7 +551,7 @@ fiber_set_cancellable(bool yesno)
 }
 
 bool
-fiber_is_cancelled()
+fiber_is_cancelled(void)
 {
 	return fiber()->flags & FIBER_IS_CANCELLED;
 }
@@ -805,7 +805,7 @@ unregister_fid(struct fiber *fiber)
 }
 
 struct fiber *
-fiber_self()
+fiber_self(void)
 {
 	return fiber();
 }
@@ -1316,20 +1316,20 @@ loop_on_iteration_end(ev_loop *loop, ev_prepare *watcher, int revents)
 }
 
 static inline void
-fiber_top_init()
+fiber_top_init(void)
 {
 	ev_prepare_init(&cord()->prepare_event, loop_on_iteration_end);
 	ev_check_init(&cord()->check_event, loop_on_iteration_start);
 }
 
 bool
-fiber_top_is_enabled()
+fiber_top_is_enabled(void)
 {
 	return fiber_top_enabled;
 }
 
 inline void
-fiber_top_enable()
+fiber_top_enable(void)
 {
 	if (!fiber_top_enabled) {
 		ev_prepare_start(cord()->loop, &cord()->prepare_event);
@@ -1348,7 +1348,7 @@ fiber_top_enable()
 }
 
 inline void
-fiber_top_disable()
+fiber_top_disable(void)
 {
 	if (fiber_top_enabled) {
 		ev_prepare_stop(cord()->loop, &cord()->prepare_event);
@@ -1702,7 +1702,7 @@ cord_set_name(const char *name)
 }
 
 bool
-cord_is_main()
+cord_is_main(void)
 {
 	return cord() == &main_cord;
 }
diff --git a/src/lib/core/fiber.h b/src/lib/core/fiber.h
index cd9346a55..fffbe8f8b 100644
--- a/src/lib/core/fiber.h
+++ b/src/lib/core/fiber.h
@@ -179,7 +179,7 @@ struct fiber_attr;
  * will not take ownership.
  */
 API_EXPORT struct fiber_attr *
-fiber_attr_new();
+fiber_attr_new(void);
 
 /**
  * Delete the fiber_attr and free all allocated resources.
@@ -219,7 +219,7 @@ typedef int (*fiber_func)(va_list);
  * Return the current fiber
  */
 API_EXPORT struct fiber *
-fiber_self();
+fiber_self(void);
 
 /**
  * Create a new fiber.
@@ -343,7 +343,7 @@ fiber_sleep(double s);
  * manually).
  */
 API_EXPORT bool
-fiber_is_cancelled();
+fiber_is_cancelled(void);
 
 /**
  * Report loop begin time as double (cheap).
@@ -666,7 +666,7 @@ cord_name(struct cord *cord)
 
 /** True if this cord represents the process main thread. */
 bool
-cord_is_main();
+cord_is_main(void);
 
 void
 fiber_init(int (*fiber_invoke)(fiber_func f, va_list ap));
@@ -689,7 +689,7 @@ fiber_name(struct fiber *f)
 }
 
 bool
-fiber_checkstack();
+fiber_checkstack(void);
 
 /**
  * @brief yield & check for timeout
@@ -699,7 +699,7 @@ bool
 fiber_yield_timeout(ev_tstamp delay);
 
 void
-fiber_destroy_all();
+fiber_destroy_all(struct cord *cord);
 
 void
 fiber_gc(void);
@@ -726,13 +726,13 @@ fiber_stat(fiber_stat_cb cb, void *cb_ctx);
 
 #if ENABLE_FIBER_TOP
 bool
-fiber_top_is_enabled();
+fiber_top_is_enabled(void);
 
 void
-fiber_top_enable();
+fiber_top_enable(void);
 
 void
-fiber_top_disable();
+fiber_top_disable(void);
 #endif /* ENABLE_FIBER_TOP */
 
 /** Useful for C unit tests */
diff --git a/src/lib/core/fiber_channel.c b/src/lib/core/fiber_channel.c
index 4bbff45c5..2ac585648 100644
--- a/src/lib/core/fiber_channel.c
+++ b/src/lib/core/fiber_channel.c
@@ -223,7 +223,7 @@ fiber_channel_delete(struct fiber_channel *ch)
 static __thread struct mempool ipc_value_pool;
 
 struct ipc_value *
-ipc_value_new()
+ipc_value_new(void)
 {
 	if (! mempool_is_initialized(&ipc_value_pool)) {
 		/*
diff --git a/src/lib/core/fiber_channel.h b/src/lib/core/fiber_channel.h
index 0e64e1459..335324dbc 100644
--- a/src/lib/core/fiber_channel.h
+++ b/src/lib/core/fiber_channel.h
@@ -76,7 +76,7 @@ void
 ipc_value_delete(struct ipc_msg *msg);
 
 struct ipc_value *
-ipc_value_new();
+ipc_value_new(void);
 
 
 /**
diff --git a/src/lib/core/fiber_cond.c b/src/lib/core/fiber_cond.c
index 4998d6494..904a350d9 100644
--- a/src/lib/core/fiber_cond.c
+++ b/src/lib/core/fiber_cond.c
@@ -52,7 +52,7 @@ fiber_cond_destroy(struct fiber_cond *c)
 static __thread struct mempool cond_pool;
 
 struct fiber_cond *
-fiber_cond_new()
+fiber_cond_new(void)
 {
 	struct fiber_cond *cond;
 	if (! mempool_is_initialized(&cond_pool)) {
diff --git a/src/lib/core/fiber_pool.c b/src/lib/core/fiber_pool.c
index d40c9bcc3..b980028e4 100644
--- a/src/lib/core/fiber_pool.c
+++ b/src/lib/core/fiber_pool.c
@@ -46,7 +46,7 @@ fiber_pool_f(va_list ap)
 	pool->size++;
 restart:
 	msg = NULL;
-	while (!stailq_empty(output) && !fiber_is_cancelled(fiber())) {
+	while (!stailq_empty(output) && !fiber_is_cancelled()) {
 		 msg = stailq_shift_entry(output, struct cmsg, fifo);
 
 		if (f->caller == &cord->sched && ! stailq_empty(output) &&
@@ -74,7 +74,7 @@ fiber_pool_f(va_list ap)
 		fiber_on_stop(f);
 	}
 	/** Put the current fiber into a fiber cache. */
-	if (!fiber_is_cancelled(fiber()) && (msg != NULL ||
+	if (!fiber_is_cancelled() && (msg != NULL ||
 	    ev_monotonic_now(loop) - last_active_at < pool->idle_timeout)) {
 		if (msg != NULL)
 			last_active_at = ev_monotonic_now(loop);
-- 
2.26.2

  parent reply	other threads:[~2020-07-03 14:47 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03 14:45 [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 01/22] version: use void for empty args Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 02/22] crc32: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 03/22] title: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 04/22] proc_title: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 05/22] systemd: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 06/22] main: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 07/22] say: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 08/22] memory: " Cyrill Gorcunov
2020-07-03 14:45 ` Cyrill Gorcunov [this message]
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 10/22] diag: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 11/22] coio: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 12/22] cbus: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 13/22] backtrace: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 14/22] call: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 15/22] call_id_cache: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 16/22] schema: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 17/22] sql: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 18/22] user: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 19/22] session: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 20/22] iproto: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 21/22] wal: " Cyrill Gorcunov
2020-07-03 14:45 ` [Tarantool-patches] [PATCH 22/22] box: " Cyrill Gorcunov
2020-07-03 21:23 ` [Tarantool-patches] [PATCH 00/22] Use void type in empty arguments list Vladislav Shpilevoy
2020-07-04  7:30   ` Cyrill Gorcunov
2020-07-05 21:19     ` Timur Safin
2020-07-05 21:37       ` Cyrill Gorcunov
2020-07-06 13:33         ` Timur Safin
2020-07-06 15:09           ` Cyrill Gorcunov
2020-07-08 12:55 ` Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200703144526.522358-10-gorcunov@gmail.com \
    --to=gorcunov@gmail.com \
    --cc=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 09/22] fiber: use void for empty args' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox