Commit 45e1dfd1 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5351 fix a test deadlock

git-svn-id: file:///svn/toku/tokudb@48720 c7de825b-a66e-492c-adef-691d508d4ae1
parent 76e79c92
...@@ -23,11 +23,13 @@ class circular_buffer { ...@@ -23,11 +23,13 @@ class circular_buffer {
void push(const T &); void push(const T &);
__attribute__((warn_unused_result))
bool trypush(const T &); bool trypush(const T &);
__attribute__((warn_unused_result))
T pop(void); T pop(void);
__attribute__((nonnull)) __attribute__((nonnull, warn_unused_result))
bool trypop(T * const); bool trypop(T * const);
private: private:
......
...@@ -88,6 +88,10 @@ static void test_with_threads(void) { ...@@ -88,6 +88,10 @@ static void test_with_threads(void) {
swapped = __sync_bool_compare_and_swap(&producers_joined, false, true); swapped = __sync_bool_compare_and_swap(&producers_joined, false, true);
invariant(swapped); invariant(swapped);
// kick it in case it's still waiting
bool pushed = buf.trypush(1);
(void) pushed; // yes, really ignore it
r = toku_pthread_join(consumer_thd, nullptr); r = toku_pthread_join(consumer_thd, nullptr);
invariant_zero(r); invariant_zero(r);
......
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