Commit cba42476 authored by Jason Madden's avatar Jason Madden

Correct the link flags to work on both manylinux images

LDFLAGS is needed on the 2010 image (for clock_gettime). The 2014
image needs -pthread (for pthread_atfork, via cffi)
parent 17128481
......@@ -45,9 +45,14 @@ else
echo "Compiling with -Ofast"
export CFLAGS="-Ofast $GEVENT_WARNFLAGS"
fi
# Needed for clock_gettime libc support on this version. This used to be spelled with LDFLAGS,
# but that is deprecated and produces a warning.
export LIBS="-lrt"
# -lrt: Needed for clock_gettime libc support on this version.
# -pthread: Needed for pthread_atfork (cffi).
# This used to be spelled with LDFLAGS, but that is deprecated and
# produces a warning on the 2014 image (?). Still needed on the
# 2010 image.
export LIBS="-lrt -pthread"
export LDFLAGS="$LIBS"
# Be sure that we get the loop we expect by default, and not
# a fallback loop.
export GEVENT_LOOP="libev-cext"
......
......@@ -108,6 +108,8 @@ class TestSemaphoreMultiThread(greentest.TestCase):
thread_acquired.set()
return thread_main
IDLE_ITERATIONS = 5
def _do_test_acquire_in_one_then_another(self,
release=True,
require_thread_acquired_to_finish=False,
......@@ -144,7 +146,7 @@ class TestSemaphoreMultiThread(greentest.TestCase):
# that get run (including time-based) the notifier may or
# may not be immediately ready to run, so this can take up
# to two iterations.)
for _ in range(3):
for _ in range(self.IDLE_ITERATIONS):
gevent.idle()
if thread_acquired.wait(timing.LARGE_TICK):
break
......@@ -155,11 +157,12 @@ class TestSemaphoreMultiThread(greentest.TestCase):
# Spin the loop to be sure that the timeout has a chance to
# process. Interleave this with something that drops the GIL
# so the background thread has a chance to notice that.
for _ in range(3):
for _ in range(self.IDLE_ITERATIONS):
gevent.idle()
if thread_acquired.wait(timing.LARGE_TICK):
break
thread_acquired.wait(timing.LARGE_TICK * 5)
if require_thread_acquired_to_finish:
self.assertTrue(thread_acquired.is_set())
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment