sync ports with The Matrix
This commit is contained in:
parent
9d4d2e721a
commit
79bc6d9d97
846 changed files with 10693 additions and 8131 deletions
48
cad/prusaslicer/patches/patch-src_libslic3r_Thread_cpp
Normal file
48
cad/prusaslicer/patches/patch-src_libslic3r_Thread_cpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
Index: src/libslic3r/Thread.cpp
|
||||
--- src/libslic3r/Thread.cpp.orig
|
||||
+++ src/libslic3r/Thread.cpp
|
||||
@@ -6,6 +6,10 @@
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
+#ifdef __OpenBSD__
|
||||
+ #include <pthread_np.h>
|
||||
+#endif
|
||||
+
|
||||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
@@ -155,6 +159,33 @@ std::optional<std::string> get_current_thread_name()
|
||||
// char buf[16];
|
||||
// return std::string(thread_getname_np(buf, 16) == 0 ? buf : "");
|
||||
return std::nullopt;
|
||||
+}
|
||||
+
|
||||
+#elif __OpenBSD__
|
||||
+
|
||||
+bool set_thread_name(std::thread &thread, const char *thread_name)
|
||||
+{
|
||||
+ pthread_set_name_np(thread.native_handle(), thread_name);
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+bool set_thread_name(boost::thread &thread, const char *thread_name)
|
||||
+{
|
||||
+ pthread_set_name_np(thread.native_handle(), thread_name);
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+bool set_current_thread_name(const char *thread_name)
|
||||
+{
|
||||
+ pthread_set_name_np(pthread_self(), thread_name);
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+std::optional<std::string> get_current_thread_name()
|
||||
+{
|
||||
+ char buf[16];
|
||||
+ pthread_get_name_np(pthread_self(), buf, 16);
|
||||
+ return std::string(buf);
|
||||
}
|
||||
|
||||
#else
|
Loading…
Add table
Add a link
Reference in a new issue