All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Han-Wen Nienhuys <hanwen@google.com>,
	Johannes Schindelin <johannes.schindelin@gmx.de>,
	Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: [PATCH 4/6] fixup! Add reftable library
Date: Mon, 04 May 2020 13:31:24 +0000	[thread overview]
Message-ID: <c41b25e963973dac1eb50cd3ae1f79741bc89ed1.1588599086.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.623.git.1588599086.gitgitgadget@gmail.com>

From: Johannes Schindelin <johannes.schindelin@gmx.de>

`usleep()` is unportable. We need to find a way _not_ to use it.

For Visual C, we can use `sleep_millisec()`, but the current design of
libreftable seems to be _really_ keen _not_ to depend on anything in
libgit.a.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 reftable/stack.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/reftable/stack.c b/reftable/stack.c
index 3c5f4a43130..2d0b831dda1 100644
--- a/reftable/stack.c
+++ b/reftable/stack.c
@@ -289,7 +289,12 @@ static int reftable_stack_reload_maybe_reuse(struct reftable_stack *st,
 		free_names(names_after);
 
 		delay = delay + (delay * rand()) / RAND_MAX + 100;
+#ifdef _MSC_VER
+		sleep_millisec(delay/1000);
+#else
+		/* TODO! fix this, `usleep()` is not portable enough for us to use */
 		usleep(delay);
+#endif
 	}
 
 	return 0;
-- 
gitgitgadget


  parent reply	other threads:[~2020-05-04 13:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 13:31 [PATCH 0/6] Minimal patch series to fix the CI runs of hn/reftable Johannes Schindelin via GitGitGadget
2020-05-04 13:31 ` [PATCH 1/6] fixup! Add reftable library Johannes Schindelin via GitGitGadget
2020-05-04 13:31 ` [PATCH 2/6] " Johannes Schindelin via GitGitGadget
2020-05-04 13:31 ` [PATCH 3/6] " Johannes Schindelin via GitGitGadget
2020-05-04 13:31 ` Johannes Schindelin via GitGitGadget [this message]
2020-05-04 13:31 ` [PATCH 5/6] " Johannes Schindelin via GitGitGadget
2020-05-04 13:31 ` [PATCH 6/6] vcxproj: adjust for the reftable changes Johannes Schindelin via GitGitGadget
2020-05-04 17:12   ` Junio C Hamano
2020-05-04 15:56 ` [PATCH 0/6] Minimal patch series to fix the CI runs of hn/reftable Junio C Hamano
2020-05-05  8:02   ` Johannes Schindelin
2020-05-04 17:04 ` Han-Wen Nienhuys
2020-05-05  8:00   ` Johannes Schindelin

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=c41b25e963973dac1eb50cd3ae1f79741bc89ed1.1588599086.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=hanwen@google.com \
    --cc=johannes.schindelin@gmx.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.