aports/testing/libcouchbase/fix_ioserver_tests.patch
Nathan Johnson a13969a544 testing/libcouchbase: new aport
http://developer.couchbase.com/community
C client library for Couchbase NoSQL database
2016-03-01 06:29:54 +00:00

55 lines
1.7 KiB
Diff

From c941e4f79748937b117aebc0ee961325b666053d Mon Sep 17 00:00:00 2001
From: Nathan Johnson <nathan@nathanjohnson.org>
Date: Sun, 28 Feb 2016 12:04:45 -0600
Subject: [PATCH] CCBC-683 Remove double calls to pthread_join in ioserver tests.
Call join() from threads-win32 close() to be consistent with pthreads.
Change-Id: I62566a588eb7036205e75945305cf2277db0e00a
---
diff --git a/tests/ioserver/connection.cc b/tests/ioserver/connection.cc
index 23712d8..7e423eb 100644
--- a/tests/ioserver/connection.cc
+++ b/tests/ioserver/connection.cc
@@ -152,7 +152,10 @@
ctlfd_user->close();
ctlfd_lsn->close();
datasock->close();
- thr->join();
+ // We don't want to explicitly call join() here since that
+ // gets called in the destructor. This is unncessary
+ // and broken on musl.
+ // thr->join();
delete thr;
mutex.close();
initcond.close();
diff --git a/tests/ioserver/ioserver.cc b/tests/ioserver/ioserver.cc
index a9bce67..c5f5b14 100644
--- a/tests/ioserver/ioserver.cc
+++ b/tests/ioserver/ioserver.cc
@@ -63,7 +63,10 @@
delete *iter;
}
mutex.unlock();
- thr->join();
+ // We don't want to explicitly call join() here since that
+ // gets called in the destructor. This is unncessary
+ // and broken on musl.
+ // thr->join();
delete thr;
mutex.close();
delete lsn;
diff --git a/tests/ioserver/threads-win32.cc b/tests/ioserver/threads-win32.cc
index 9ed9614..1e5710a 100644
--- a/tests/ioserver/threads-win32.cc
+++ b/tests/ioserver/threads-win32.cc
@@ -36,6 +36,7 @@
Thread::close()
{
if (initialized) {
+ join();
CloseHandle(hThread);
initialized = false;
}