Change in osmo-trx[master]: Move duplicated thread_enable_cancel to CommonLibs

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Fri Apr 26 16:51:16 UTC 2019


Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13785 )

Change subject: Move duplicated thread_enable_cancel to CommonLibs
......................................................................

Move duplicated thread_enable_cancel to CommonLibs

Change-Id: I1a479b59bdda01233273dfa919bd678edbe34708
---
M CommonLibs/Threads.cpp
M CommonLibs/Threads.h
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/uhd/UHDDevice.cpp
4 files changed, 7 insertions(+), 12 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/CommonLibs/Threads.cpp b/CommonLibs/Threads.cpp
index 2988e12..c056d69 100644
--- a/CommonLibs/Threads.cpp
+++ b/CommonLibs/Threads.cpp
@@ -122,6 +122,12 @@
 	}
 }
 
+void thread_enable_cancel(bool cancel)
+{
+	cancel ? pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) :
+		 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
+}
+
 void Thread::start(void *(*task)(void*), void *arg)
 {
 	assert(mThread==((pthread_t)0));
diff --git a/CommonLibs/Threads.h b/CommonLibs/Threads.h
index 3b76985..4c5b9ee 100644
--- a/CommonLibs/Threads.h
+++ b/CommonLibs/Threads.h
@@ -142,6 +142,7 @@
 	thread.start((void *(*)(void*))function, (void*)argument);
 
 void set_selfthread_name(const char *name);
+void thread_enable_cancel(bool cancel);
 
 /** A C++ wrapper for pthread threads.  */
 class Thread {
diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index b924fa7..0cd41d3 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -90,12 +90,6 @@
 	LOGLV(DLMS, lvl_map[lvl]) << msg;
 }
 
-static void thread_enable_cancel(bool cancel)
-{
-	cancel ? pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) :
-		 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
-}
-
 static void print_range(const char* name, lms_range_t *range)
 {
 	LOGC(DDEV, INFO) << name << ": Min=" << range->min << " Max=" << range->max
diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp
index 765150f..46284e5 100644
--- a/Transceiver52M/device/uhd/UHDDevice.cpp
+++ b/Transceiver52M/device/uhd/UHDDevice.cpp
@@ -357,12 +357,6 @@
 }
 #endif
 
-static void thread_enable_cancel(bool cancel)
-{
-	cancel ? pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) :
-		 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
-}
-
 uhd_device::uhd_device(size_t tx_sps, size_t rx_sps,
 		       InterfaceType iface, size_t chans, double lo_offset,
 		       const std::vector<std::string>& tx_paths,

-- 
To view, visit https://gerrit.osmocom.org/13785
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1a479b59bdda01233273dfa919bd678edbe34708
Gerrit-Change-Number: 13785
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190426/937adac8/attachment.html>


More information about the gerrit-log mailing list