summaryrefslogtreecommitdiff
path: root/lib/libthr/thread/thr_info.c
Commit message (Collapse)AuthorAgeFilesLines
* Add pthread_getname_np() and pthread_setname_np() aliases forKonstantin Belousov2020-06-101-17/+59
| | | | | | | | | | | | | | | pthread_get_name_np() and pthread_set_name_np(). This re-applies r361770 after compatibility fixes. Reviewed by: antoine, jkim, markj Tested by: antoine (exp-run) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25117 Notes: svn path=/head/; revision=362032
* Revert r361770 "Add pthread_getname_np() and pthread_setname_np() aliases" ↵Konstantin Belousov2020-06-041-2/+0
| | | | | | | | | | | | for now. It is not compatible enough with Linux. Requested by: antoine, jkim Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=361784
* Add pthread_getname_np() and pthread_setname_np() aliasesKonstantin Belousov2020-06-031-0/+2
| | | | | | | | | | | | | | for pthread_get_name_np() and pthread_set_name_np(), to be compatible with Linux. PR: 238404 Proposed and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25117 Notes: svn path=/head/; revision=361770
* Restore ability to pass NULL name argument to pthread_set_name_np(3)Konstantin Belousov2019-07-111-1/+1
| | | | | | | | | | | to clear the thread name. PR: 239142 Submitted by: Lewis Donzis <lew@perftech.com> MFC after: 3 days Notes: svn path=/head/; revision=349912
* Add pthread_get_name_np(3).Konstantin Belousov2018-08-171-11/+53
| | | | | | | | | | | | | | | | The function retrieves the thread name previously set by pthread_set_name_np(3). The name is cached in the process memory. Requested by: Willem Jan Withagen <wjw@digiware.nl> Man page update: Yuri Pankov <yuripv@yuripv.net> Reviewed by: ian (previous version) Discussed with: arichardson, bjk (man page) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D16702 Notes: svn path=/head/; revision=337983
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* Use __FBSDID() for .c files from lib/libthr/thread.Konstantin Belousov2016-04-081-2/+3
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=297706
* Simplify code by replacing _thr_ref_add() with _thr_find_thread().David Xu2012-07-201-5/+1
| | | | Notes: svn path=/head/; revision=238644
* If a thread who's name is being set is not the current thread, use macrosDavid Xu2007-04-051-2/+2
| | | | | | | | | | THR_THREAD_LOCK and THR_THREAD_UNLOCK instead, this should fix wrong lock level problem. Bug reported by: ed dot maste at gmail dot com Notes: svn path=/head/; revision=168382
* Remove 3rd clause, renumber, ok per emailWarner Losh2007-01-121-4/+1
| | | | Notes: svn path=/head/; revision=165967
* WARNS level 4 cleanup.David Xu2006-04-041-2/+5
| | | | Notes: svn path=/head/; revision=157457
* use syscall thr_set_name to implement pthread_set_name_np.David Xu2006-02-051-9/+18
| | | | Notes: svn path=/head/; revision=155329
* Add missing symbol pthread_set_name_np.David Xu2006-01-231-0/+2
| | | | Notes: svn path=/head/; revision=154703
* Rescue pthread_set_name_np for compatible reason, remove unused code.David Xu2006-01-091-151/+9
| | | | Notes: svn path=/head/; revision=154130
* Import my recent 1:1 threading working. some features improved includes:David Xu2005-04-021-41/+48
| | | | | | | | | | | | | | | | | | | 1. fast simple type mutex. 2. __thread tls works. 3. asynchronous cancellation works ( using signal ). 4. thread synchronization is fully based on umtx, mainly, condition variable and other synchronization objects were rewritten by using umtx directly. those objects can be shared between processes via shared memory, it has to change ABI which does not happen yet. 5. default stack size is increased to 1M on 32 bits platform, 2M for 64 bits platform. As the result, some mysql super-smack benchmarks show performance is improved massivly. Okayed by: jeff, mtm, rwatson, scottl Notes: svn path=/head/; revision=144518
* Start locking up the active and dead threads lists. The active threadsMike Makonnen2003-05-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | list is protected by a spinlock_t, but the dead list uses a pthread_mutex because it is necessary to synchronize other threads with the garbage collector thread. Lock/Unlock macros are used so it's easier to make changes to the locks in the future. The 'dead thread list' lock is intended to replace the gc mutex. This doesn't have any practical ramifications. It simply makes it clearer what the purpose of the lock is. The gc will use this lock, instead of the gc mutex, to synchronize access to the dead list with other threads. Modify _pthread_exit() to use these two new locks instead of GIANT_LOCK, and also to properly lock and protect thread state changes, especially with respect to a joining thread. The gc thread was also re-arranged to be more organized and less nested. _pthread_join() was also modified to use the thread list locks. However, locking and unlocking here needs special care because a thread could find itself in a position where it's joining an exiting thread that is waiting on the dead list lock, which this thread (joiner) holds. If the joiner doesn't take care to lock *and* unlock in the same order they (the joiner and the joinee) could deadlock against each other. Approved by: re/blanket libthr Notes: svn path=/head/; revision=115305
* - Define curthread as _get_curthread() and remove all direct calls toJeff Roberson2003-04-021-1/+0
| | | | | | | | | | _get_curthread(). This is similar to the kernel's curthread. Doing this saves stack overhead and is more convenient to the programmer. - Pass the pointer to the newly created thread to _thread_init(). - Remove _get_curthread_slow(). Notes: svn path=/head/; revision=112965
* - Add libthr but don't hook it up to the regular build yet. This is anJeff Roberson2003-04-011-0/+193
adaptation of libc_r for the thr system call interface. This is beta quality code. Notes: svn path=/head/; revision=112918