summaryrefslogtreecommitdiff
path: root/lib/libpthread
AgeCommit message (Collapse)Author
2021-10-05Pull up following revision(s) (requested by christos in ticket #1355):martin
lib/libpthread/pthread_cancelstub.c: revision 1.39 lib/libc/sys/Makefile.inc: revision 1.247 lib/libpthread/pthread_cancelstub.c: revision 1.40 PR/56424: Clay Mayers: recvfrom() is not a cancelation point as documented in pthread_setcanceltype.3 remove parameter names from decls.
2020-04-12Pull up following revision(s) (requested by rin in ticket #826):martin
lib/libpthread/arch/powerpc/pthread_md.h: revision 1.9 sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.48 Revert previous: http://mail-index.netbsd.org/source-changes/2020/02/20/msg114173.html Comment turned out to be wrong, and KASSERT fires for oea. XXX Need to revisit shortly...
2020-02-27Pull up following revision(s) (requested by rin in ticket #736):martin
lib/libpthread/arch/powerpc/pthread_md.h: revision 1.8 sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.47 libpthread sets initial value of MSR for lwp's. However, appropriate value differs b/w oea/booke/ibm4xx, and there's no way to obtain it from userland. Therefore, this initial value should be corrected by cpu_setmcontext(). - Comment this in libpthread - Add KASSERT in cpu_mcontext_validate()
2020-01-26Pull up following revision(s) (requested by ad in ticket #647):martin
lib/libpthread/pthread_rwlock.c: revision 1.37 (patch) lib/libpthread/pthread_misc.c: revision 1.16 lib/libpthread/pthread.c: revision 1.154 lib/libpthread/pthread_int.h: revision 1.98 lib/libpthread/pthread_cond.c: revision 1.66 lib/libpthread/pthread_mutex.c: revision 1.66 Rip out some very ambitious optimisations around pthread_mutex that are don't buy much. This stuff is hard enough to get right in the kernel let alone userspace, and I don't trust that it's right.
2019-12-18Pull up following revision(s) (requested by joerg in ticket #571):martin
lib/libpthread/pthread_int.h: revision 1.97 Bump PTHREAD__UNPARK_MAX to 128 as bandaid for locking related hangs.
2019-09-27Pull up following revision(s) (requested by brad in ticket #252):martin
external/cddl/osnet/lib/libzpool/Makefile: revision 1.13 lib/libpthread/Makefile: revision 1.95 external/cddl/osnet/lib/libuutil/Makefile: revision 1.6 distrib/sets/lists/base/shl.mi: revision 1.871 external/cddl/osnet/lib/libzfs_core/Makefile: revision 1.2 external/cddl/osnet/lib/libnvpair/Makefile: revision 1.11 external/cddl/osnet/lib/libzfs/Makefile: revision 1.10 external/cddl/osnet/lib/libavl/Makefile: revision 1.6 distrib/sets/lists/debug/shl.mi: revision 1.230 external/cddl/osnet/lib/libumem/Makefile: revision 1.7 Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used by /sbin/{zfs,zpool,mount_zfs}. The general effect is to move them from /usr/lib to /lib. Compatibility links are installed in /usr/lib and nothing that is installed, say in /usr/pkg, appears to break. With this, it is possible to have a /var and /usr mount using ZFS legacy mounting early on in the boot process. Run tested on amd64 and i386 and compile tested on evbarm. Fix MKDEBUG distrib sets Add libpthread, libnvpair and ZFS libs to dynamicroot.
2019-09-13Pull up following revision(s) (requested by kamil in ticket #198):martin
lib/libpthread/thrd.c: revision 1.4 lib/libpthread/threads.h: revision 1.3 Switch back _Noreturn to __dead in C11 threads There is an ongoing discussion to unify unreturn attribute between C and C++, making a compatible version, shared between languages. Instead of picking C11-only approach here, switch back to __dead that wraps the compiler extension for the same purpose. This change makes this header more compatible with C++ and pre-C11. Reference: <a rel="nofollow" href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2410.pdf">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2410.pdf</a>
2019-05-07Make CLEANFILES actually work. .TARGET is not defined when not in a targetmaya
rule. Thanks xtos for the heads up.
2019-05-07Replace the link command for libpthread.a so that we create a single sectionmaya
with all the libpthread symbols in it. This makes -lpthread behave like to -Wl,--whole-archive -lpthread. This avoids a situation where threaded static binaries use some libc thread stubs, which are racy. Fixes PR lib/54001: call_once2_32, call_once2_static test cases failing on amd64 since gcc7 import. Suggested by Jonathan Wakely, thanks!
2019-04-29Avoid incompatible function pointer casts in thrd_create(3)kamil
Use an intermediate function trampoline to workaround different function pointer prototypes. While there, correct scenario returning thrd_nomem from thrd_create(3). In practice ENOMEM is rarely returned from pthread(3). Older code worked on tested ports, but was depending on unneeded UB.
2019-04-27Fix some typos, improve wording.wiz
2019-04-24Drop error path from C11 call_oncekamil
The original implementation of C11 threads(3) contained check for error paths, but it was stripped in the calls that are documented to return no status from an operation. Do the same in call_once(3).
2019-04-24Introduce minor changes to the C11 threading librarykamil
Switch tss_t type from int to pthread_key_t (no functional change as pthread_key_t was already typedefed as int). Noted by <enh from Google>. Use C11 _Noreturn in thrd_exit(3) instead of NetBSD specific __dead. The former is documented in the standard as an attribute of thrd_exit(3), the latter is more portable to pre-C11 compilers, however C11 thread support library needs C11 compiler for TLS anyway. __dead made a little bit more point 3 years ago than today as 3 years ago pre-C11 compilers were more common.
2019-04-24Bump the libpthread(3) minor number to 4kamil
Added C11 Threading library support.
2019-04-24Add a complete C11 threads(3) implementationkamil
C11 Thread support library is a portable threading C API between OSs, similar to std::threads in the C++ world. The library is implemented as a thin shim over POSIX interfaces. NetBSD implements the API as a part of the POSIX threading library (libpthread(3)). C11 threads(3) are in the process of making them an integral part of the POSIX standard. The interface has been implemented in major OSs and used with stopgap libraries for older versions of them. C11 threading library is already used (with a stopgap implementation) in the NetBSD distribution in MESA. Original implementation by myself from 2016. ATF tests are new and cover almost all interfaces. Proposed on tech-userlevel@.
2019-03-05Jemalloc initializes mutexes before we become threaded and expects to usechristos
them later.
2019-03-05Transfer all the keys that were created in the libc stub implementationchristos
to the pthread tsd implementation when the main thread is created. This corrects a problem where a process created keys before libpthread was loaded (either from the libc constructor or because libpthread was dlopened later). This fixes a problem with jemalloc which creates keys in the constructor.
2019-02-03Implement support for "pshared" POSIX semaphores.thorpej
Fixes lib/53273 (and Firefox's multi-process tab feature).
2018-11-22G/C __APCS_26__ supportskrll
2018-09-09Add a todo item for a future major bump (rename many symbols)maya
2018-08-19Drop a duplicate instruction linekamil
No functional change intended.
2018-07-28PR lib/53477 (rudolf at eq.cz) - correct an obvious mistake.kre
2018-06-09But set NOSANITIZERchristos
2018-06-09We can't build those three with MKSANITIZER, they are used too early.christos
2018-02-25remove hard-coded -fomit-frame-pointer for pthread stuff,chs
let these use the same setting as the rest of the tree. the performance difference is marginal and this allows dtrace ustack() to work better.
2018-02-20Remove namespace restriction from pthread_condattr_{g,s}etclock(3)kamil
These functions were marked as _NETBSD_SOURCE when introduced to the sources. In fact they are regular POSIX threading functions available since the 2001 standard. There is an older mention about alignment with "IEEE Std 1003.1j-2000". This corrects usage of these functions when a source code is compiled with a POSIX namespace option.
2018-02-06fix duplicate declaration of pthread_atfork in unistd.hchristos
2017-12-26Needs to be protected since it has a timespec argument. Found by lint(1)christos
2017-12-08Revert last 2 updates - these are, of course, not needed at all...kre
2017-12-08This time do _lwp_park() timeout unconsting correctly not just compilably.kre
2017-12-08Deal with more lwp_park() timestamp unconstingkre
2017-12-08unconst the timestampchristos
2017-10-23Remove superfluous Tn.wiz
2017-10-22All the four functions described in the man page conform to POSIX.1abhinav
2017-10-22Add missing word in the sentenceabhinav
2017-10-22Add missing function names in the NAME section for rest of the man pages in ↵abhinav
libpthread
2017-10-22Remove description of pthread_barrierattr_getpshared and ↵abhinav
pthread_barrierattr_setpshared These functions are described in pthread_barrierattr(3) man page
2017-10-22Add rest of the pthread_barrier functions in the NAME sectionabhinav
2017-10-22Add pthread_attr_setdetachstate to NAME sectionabhinav
2017-10-22Add pthread_getattr_np to the NAME sectionabhinav
2017-09-09Support <pthread_typs.h> on C89 compilerskamil
Clang 5.0.0(svn) reports warnings on <pthread_types.h> for C99 constructs when used with strict -std=c89. Restrict designated initializers usage to C99 or newer code. C89 and C++ will share the same code without extension of designated initializers. PR 52285
2017-08-01pthread__attr_init_private:martin
malloc+memset -> calloc. Also initialize all values to the proper defaults. This fixes the "rustc panic" discussed on pkgsrc-users. OK: joerg
2017-07-17Typo in commentskrll
2017-07-11Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. Thisjoerg
functions are used for destructors of thread_local objects. If a pending destructor exists, prevent unloading of shared objects. Introduce __dl_cxa_refcount interface for this purpose. When the last reference is gone and the object has been dlclose'd before, the unloading is finalized. Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists on providing __cxa_thread_atexit as direct wrapper without further patching.
2017-07-09PR/52386: Use the number of iterations we document.christos
2017-07-03Remove workaround for ancient HTML generation code.wiz
2017-07-02Do not look at environmental variables for suid/guid binaries.joerg
2017-07-02Export the guard size of the main thread via vm.guard_size. Add ajoerg
complementary writable sysctl for the initial guard size of threads created via pthread_create. Let the existing attribut accessors do the right thing. Raise the default guard size for threads to 64KB.
2017-03-28Remove outdated CAVEATS.maya
Not sure everything is standards compliant, but I've been told non-default values are supported and pshared exists.
2017-03-05Fix man page ERRORS section for (clock,pthread}_getcpuclockid to matchnjoly
reality.