Annotation of mystuff-orcaslicer/cad/orcaslicer/patches/patch-src_libslic3r_Thread_cpp, Revision 1.1
1.1 ! afresh1 1: Index: src/libslic3r/Thread.cpp
! 2: --- src/libslic3r/Thread.cpp.orig
! 3: +++ src/libslic3r/Thread.cpp
! 4: @@ -4,6 +4,8 @@
! 5: #else
! 6: // any posix system
! 7: #include <pthread.h>
! 8: + // OpenBSD
! 9: + #include <pthread_np.h>
! 10: #endif
! 11:
! 12: #include <atomic>
! 13: @@ -161,26 +163,27 @@ std::optional<std::string> get_current_thread_name()
! 14: // posix
! 15: bool set_thread_name(std::thread &thread, const char *thread_name)
! 16: {
! 17: - pthread_setname_np(thread.native_handle(), thread_name);
! 18: + pthread_set_name_np(thread.native_handle(), thread_name);
! 19: return true;
! 20: }
! 21:
! 22: bool set_thread_name(boost::thread &thread, const char *thread_name)
! 23: {
! 24: - pthread_setname_np(thread.native_handle(), thread_name);
! 25: + pthread_set_name_np(thread.native_handle(), thread_name);
! 26: return true;
! 27: }
! 28:
! 29: bool set_current_thread_name(const char *thread_name)
! 30: {
! 31: - pthread_setname_np(pthread_self(), thread_name);
! 32: + pthread_set_name_np(pthread_self(), thread_name);
! 33: return true;
! 34: }
! 35:
! 36: std::optional<std::string> get_current_thread_name()
! 37: {
! 38: char buf[16];
! 39: - return std::string(pthread_getname_np(pthread_self(), buf, 16) == 0 ? buf : "");
! 40: + pthread_get_name_np(pthread_self(), buf, 16);
! 41: + return std::string(buf);
! 42: }
! 43:
! 44: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>