summaryrefslogtreecommitdiff
path: root/threadproc/netware
Commit message (Collapse)AuthorAgeFilesLines
* apr_thread: Follow up to r1897207: apr_thread_current_create() compilation.Yann Ylavic2022-02-081-0/+1
| | | | | | | | | | | | Fix compilation of apr_thread_current_create() for OS/2 and Windows. Set *current to NULL on failure. Merge r1897879 from trunk. Submitted by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1897880 13f79535-47bb-0310-9956-ffa450edef68
* apr_thread: Follow up to r1897207: Provide apr_thread_current_after_fork().Yann Ylavic2022-01-252-0/+10
| | | | | | | | | | | | | | | thread_local variables are not (always?) reset on fork(), so APR (and the user) needs a way to set the current_thread to NULL. Use apr_thread_current_after_fork() in apr_proc_fork()'s child process. Merge r1897470 from trunk. Submitted by: ylavic Reviewed by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1897471 13f79535-47bb-0310-9956-ffa450edef68
* apr_thread: Follow up to r1897207: Make APR_HAS_THREAD_LOCAL a boolean..Yann Ylavic2022-01-251-4/+4
| | | | | | | | | | | .. rather than a defined(). Merge r1897447 from trunk. Submitted by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1897448 13f79535-47bb-0310-9956-ffa450edef68
* apr_thread: Follow up to r1897207: Don't NULLify current_thread on exit.Yann Ylavic2022-01-251-7/+1
| | | | | | | | | | | It's not needed, when the thread exits it's not accessible anyway. Merge r1897445 from trunk. Submitted by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1897446 13f79535-47bb-0310-9956-ffa450edef68
* apr_thread: Follow up to r1897179: abort_fn on apr_allocator_create() failure.Yann Ylavic2022-01-241-2/+4
| | | | | | | | Merge r1897419 from trunk. Submitted by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1897420 13f79535-47bb-0310-9956-ffa450edef68
* apr_thread: Use compiler's TLS to track the current apr_thread_t's pointer.Yann Ylavic2022-01-191-23/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All modern compilers provide a Thread Local Storage keyword that allows to store per-thread data efficiently (C++11 's thread_local, C11's _Thread_local, gcc/clang's __thread or MSVC's __declspec(thread)). Use that to have an apr_thread_t pointer associated with each thread created by apr_thread_create() or any native thread (like the process' initial thread) that registered itself with the new apr_thread_current_create() function. This mechanism allows to implement apr_thread_current() quite efficiently, if available, otherwise the function returns NULL. If available APR_HAS_THREAD_LOCAL is #define'd to 1 and the APR_THREAD_LOCAL macro is the keyword usable to register TLS variables natively. Both APR_HAS_THREAD_LOCAL and APR_THREAD_LOCAL are #undef'ined if the compiler does not provide the mechanism. This allows to test for the functionality at compile time. When APR_HAS_THREAD_LOCAL, the user can load his/her own TLS data with: apr_thread_data_get(&my_data, my_key, apr_thread_current()); and store them with: apr_thread_data_set(my_data, my_key, my_data_cleanup, apr_thread_current()); which can be nice to avoid the proliferation of native TLS keys. Merge r1897207 from trunk: Submitted by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1897223 13f79535-47bb-0310-9956-ffa450edef68
* apr_thread: Allocate the apr_thread_t struct on the thread's pool.Yann Ylavic2022-01-191-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | apr_thread_create() was allocating the created apr_thread_t on the given pool, which caused e.g. short-living threads to leak memory on that pool without a way to clear it (while some threads are still running). Change this by allocating the apr_thread_t on the thread's pool itself, which is safe in the implementations of all archs because none uses the apr_thread_t after the thread exits, and it's safe for the users provided they don't use the apr_thread_t for detached threads or for attached threads after the call to apr_thread_join(). These are hardly new requirements though. apr_thread: Follow up to r1897197: Safer apr_thread_join(). Make sure apr_thread_join() behaves correctly w.r.t. the returned value and pool destroy for all archs. Merge r1897197, r1897198 from trunk. Submitted by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1897221 13f79535-47bb-0310-9956-ffa450edef68
* apr_thread: Follow up to r1884078: Unmanaged pools for attached threads too.Yann Ylavic2022-01-191-52/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | r1884078 fixed lifetime issues with detached threads by using unmanaged pool destroyed by the thread itself on exit, with no binding to the parent pool. This commit makes use of unmanaged pools for attached threads too, they needed their own allocator anyway due to apr_thread_detach() being callable anytime later. apr__pool_unmanage() was a hack to detach a subpool from its parent, but if a subpool needs its own allocator for this to work correctly there is no point in creating a subpool for threads (no memory reuse on destroy for short living threads for instance). Since an attached thread has its own lifetime now, apr_thread_join() must be called to free its resources/pool, though it's no different than before when destroying the parent pool was UB if the thread was still running (i.e. not joined yet). Let's acknoledge that threads want no binding with the pool passed to them at creation time, besides the abort_fn which they can steal :) Merge r1897179 from trunk. Submitted by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1897220 13f79535-47bb-0310-9956-ffa450edef68
* Merge r936323, r1460182, r1884077, r1884078 from trunk:Yann Ylavic2020-12-041-5/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OS/2: Clean up a thread's pool when it terminates. <not backported in 1.7.x> Add apr_pool_owner_set function to allow use of pool debugging with threads Actually this function has been mentioned in the docs for over 10 years but has never been implemented. </not backported in 1.7.x> Also consistently destroy the thread's pool when it exits normally, not only on apr_thread_exit(). This was already done on OS2. Other platforms than unix are untested. apr_thread: destroy the thread's pool at _join() time, unless _detach()ed. Destroying a joinable thread pool from apr_thread_exit() or when the thread function returns, i.e. from inside the thread itself, is racy or deadlocky with APR_POOL_DEBUG, with the parent pool being destroyed. This commit adds a ->detached flag in each arch's apr_thread_t struct to track whether a thread is detached (either at _create() or _detach() time). If detached, the pool is destroyed when the thread exits, otherwise when the thread is joined with apr_thread_join(). apr_thread: use unmanaged pools for detached threads. A detached thread is by definition out of control, unjoinable, unmanaged, and it can terminate/exit after its parent pool is detroyed. To avoid use-after-free in this case, let's use an unmanaged pool for detached threads, either by creating an unmanaged pool from the start if the thread is created detached, or by "unmanaging" the pool if the thread is detached later with apr_thread_detach(). To "umanage" the pool, provide a new internal helper, apr__pool_unmanage() which takes care of removing the pool from its parent's list. Submitted by: bjh, sf, ylavic, ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1884103 13f79535-47bb-0310-9956-ffa450edef68
* Fixed type; fixed comments.Guenter Knauf2014-07-161-4/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1611061 13f79535-47bb-0310-9956-ffa450edef68
* Merge r741862, r741866 from trunk:Jim Jagielski2014-04-281-0/+8
| | | | | | | | | Add object perms set macros and implement them for shm and mutex Submitted by: mturk, rpluem Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1590617 13f79535-47bb-0310-9956-ffa450edef68
* revret 1533105Jim Jagielski2013-10-171-8/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1533107 13f79535-47bb-0310-9956-ffa450edef68
* Merge r1533104 from trunk:Jim Jagielski2013-10-171-0/+8
| | | | | | | | | it should really handle src==NULL Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1533105 13f79535-47bb-0310-9956-ffa450edef68
* Fixed NetWare prototype warnings.Guenter Knauf2011-03-102-5/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1080082 13f79535-47bb-0310-9956-ffa450edef68
* Fixed compilation when APR_HAVE_STRUCT_RLIMIT=0.Guenter Knauf2011-03-101-3/+17
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1080074 13f79535-47bb-0310-9956-ffa450edef68
* Axed C++ comments and tabs.Guenter Knauf2011-02-181-27/+26
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1071966 13f79535-47bb-0310-9956-ffa450edef68
* Merge r783722 from trunk:Ruediger Pluem2009-06-111-1/+1
| | | | | | | | | | | | * We need to disable inheritance in the case of success like in the cases for stdout and stdin. Fixes the same issue fixed for unix in r783398 Submitted by: rpluem Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@783725 13f79535-47bb-0310-9956-ffa450edef68
* Fix up a few netware'isms and missing brackets left over from the refactoring.Bradley Nicholes2007-10-161-6/+10
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@585260 13f79535-47bb-0310-9956-ffa450edef68
* Backport the std handling improvements to Netware, OS2, BeOS.William A. Rowe Jr2007-10-151-93/+130
| | | | | | | | | | | | | | | | | | | | | These may need massaging and do need review by their respective communities. Note that someone from the OS2 community needs to ping me with resolving the missing apr_arch_inherit.h mess; this should be very easy to translate into DosSetFHState(handle, OPEN_FLAGS_NOINHERIT); bits, but to more thoroughly resolve the issue, we should take it a step further and consider the NT implementation which toggles inheritance on only for handles as they hit proc_create, so that you don't have cross-process handle leakage into the wrong processes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584928 13f79535-47bb-0310-9956-ffa450edef68
* * Remove unnecessary assignment of pool attribute.Ruediger Pluem2007-10-131-1/+0
| | | | | | | | Submitted by: Lucian Adrian Grijincu <lucian.grijincu gmail.com> Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584411 13f79535-47bb-0310-9956-ffa450edef68
* Fix the typo.Joe Orton2006-08-035-5/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@428317 13f79535-47bb-0310-9956-ffa450edef68
* Update license header.Joe Orton2006-08-035-30/+30
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@428313 13f79535-47bb-0310-9956-ffa450edef68
* Update copyright year to 2005 and standardize on current copyright owner line.Justin Erenkrantz2005-02-045-5/+10
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151412 13f79535-47bb-0310-9956-ffa450edef68
* NetWare implementation of apr_procattr_user_set() and apr_procattr_group_set()Bradley Nicholes2005-01-181-2/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125520 13f79535-47bb-0310-9956-ffa450edef68
* Added apr_procattr_user_set and apr_procattr_group_set to allow setting ↵Mladen Turk2005-01-161-0/+12
| | | | | | uid/gid for newly created processes using apr_proc_create. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125349 13f79535-47bb-0310-9956-ffa450edef68
* Fixing various compiler errors when compiling against the latest version of ↵Bradley Nicholes2004-11-271-1/+1
| | | | | | LibC SDK git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@106767 13f79535-47bb-0310-9956-ffa450edef68
* rev back to r1.29 , removing changes to addrspace and detach set functionsJean-Jacques Clar2004-07-121-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65277 13f79535-47bb-0310-9956-ffa450edef68
* Added bit mask operation for detach and addrspace fields to make possible ↵Jean-Jacques Clar2004-07-091-2/+2
| | | | | | overloading on fcts parameter. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65276 13f79535-47bb-0310-9956-ffa450edef68
* Added new APR API to load child process in current or new address space ↵Jean-Jacques Clar2004-06-141-3/+9
| | | | | | | | | | (NetWare ONLY). Replaced changes that added APR_PROGRAM_ADDRSPACE committed 6/11/04. Reviewed by Brad Nicholes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65196 13f79535-47bb-0310-9956-ffa450edef68
* Replaced APR_PROGRAM_ENV with new enum APR_PROGRAM_ADDRSPACE when starting a ↵Jean-Jacques Clar2004-06-111-4/+3
| | | | | | child program git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65184 13f79535-47bb-0310-9956-ffa450edef68
* Add apr_threadattr_guardsize_set function, which allows changingJoe Orton2004-06-101-0/+6
| | | | | | | | | | | | | | | | | | | the thread guard area size attribute for newly created threads. * configure.in: Check for pthread_attr_setguardsize. * include/apr_thread_proc.h (apr_threadattr_guardsize_set): Add prototype. * threadproc/unix/thread.c (apr_threadattr_guardsize_set): Add function. * threadproc/os2/thread.c, threadproc/win32/thread.c, threadproc/beos/thread.c, threadproc/netware/thread.c (apr_threadattr_guardsize_set): Add ENOTIMPL stubs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65179 13f79535-47bb-0310-9956-ffa450edef68
* APR_ENOTIMPL is more appropriate (rather than APR_SUCCESS) forMadhusudan Mathihalli2004-04-221-2/+2
| | | | | | | apr_signal_block, apr_signal_unblock (since they're not implemented) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65078 13f79535-47bb-0310-9956-ffa450edef68
* Added two new functions apr_signal_block and apr_signal_unblock toMadhusudan Mathihalli2004-04-211-0/+10
| | | | | | | | | | block/unblock only certain signals. The functions are currently enabled for Unix (beos, os2). It's a null function for win32 and netware (I really don't know if they even require such a feature) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65076 13f79535-47bb-0310-9956-ffa450edef68
* Add apr_threadattr_stacksize_set() for overriding the defaultJeff Trawick2004-03-011-0/+7
| | | | | | | | | stack size for threads created by apr_thread_create(). This is currently a not-implemented stub for BeOS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64934 13f79535-47bb-0310-9956-ffa450edef68
* Relicense APR under Apache License, Version 2.0Justin Erenkrantz2004-02-135-245/+50
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64904 13f79535-47bb-0310-9956-ffa450edef68
* axe these deprecated functions:Jeff Trawick2003-09-031-6/+0
| | | | | | | | | | | | | | | | apr_allocator_get_mutex apr_allocator_get_owner apr_allocator_set_max_free apr_allocator_set_mutex apr_allocator_set_owner apr_pool_get_abort apr_pool_get_parent apr_pool_set_abort apr_pool_sub_make apr_signal_get_description git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64606 13f79535-47bb-0310-9956-ffa450edef68
* Default spawned threads to detached so we avoid hanging on a waitpid() callBradley Nicholes2003-03-101-1/+1
| | | | | | | since NetWare doesn't yet have a way to kill a spawned NLM. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64418 13f79535-47bb-0310-9956-ffa450edef68
* Default the current directory in the proc_attr structure since the NetWare OSBradley Nicholes2003-03-041-0/+2
| | | | | | | doesn't have a process shell that handles it. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64395 13f79535-47bb-0310-9956-ffa450edef68
* Enable APR_PROGRAM_ENV as a command typeBradley Nicholes2003-02-111-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64348 13f79535-47bb-0310-9956-ffa450edef68
* Implemented apr_proc_wait and apr_wait_all_procs for NetWareBradley Nicholes2003-02-111-33/+59
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64345 13f79535-47bb-0310-9956-ffa450edef68
* add apr_procattr_error_check_set() for telling apr_proc_create() toJeff Trawick2003-02-071-0/+7
| | | | | | | | try to anticipate any errors that might occur after fork() (no-op everywhere but Unix) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64341 13f79535-47bb-0310-9956-ffa450edef68
* Allow apr_proc_create() to call an app-provided error reportingJeff Trawick2003-02-061-0/+7
| | | | | | | | | | function when apr_proc_create() fails in the new child process after fork(). The app-provided error reporting function will only be called on platforms where apr_proc_create() first calls fork() to create the new process. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64330 13f79535-47bb-0310-9956-ffa450edef68
* Always load the NLM detached so that we don't have to wait for it to cleanBradley Nicholes2003-01-141-2/+5
| | | | | | | up when it terminates. Also check for the correct return value for procve() git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64297 13f79535-47bb-0310-9956-ffa450edef68
* rename apr_arch_fileio.h to apr_arch_file_io.h for consistencyThom May2003-01-071-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64275 13f79535-47bb-0310-9956-ffa450edef68
* Namespace protection for include/arch/ header filesThom May2003-01-065-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | aix/dso.h -> -> aix/apr_arch_dso.h beos/dso.h -> beos/apr_arch_dso.h beos/proc_mutex.h -> beos/apr_arch_proc_mutex.h beos/thread_cond.h -> beos/apr_arch_thread_cond.h beos/thread_mutex.h -> beos/apr_arch_thread_mutex.h beos/threadproc.h -> beos/apr_arch_threadproc.h beos/thread_rwlock.h -> beos/apr_arch_thread_rwlock.h netware/dso.h -> -> netware/apr_arch_dso.h netware/fileio.h -> -> netware/apr_arch_fileio.h netware/global_mutex.h -> netware/apr_arch_global_mutex.h netware/internal_time.h -> netware/apr_arch_internal_time.h netware/networkio.h -> netware/apr_arch_networkio.h netware/pre_nw.h -> netware/apr_arch_pre_nw.h netware/proc_mutex.h -> netware/apr_arch_proc_mutex.h netware/thread_cond.h -> netware/apr_arch_thread_cond.h netware/thread_mutex.h -> netware/apr_arch_thread_mutex.h netware/threadproc.h -> netware/apr_arch_threadproc.h netware/thread_rwlock.h -> netware/apr_arch_thread_rwlock.h os2/dso.h -> os2/apr_arch_dso.h os2/fileio.h -> os2/apr_arch_fileio.h os2/networkio.h -> os2/apr_arch_networkio.h os2/os2calls.h -> os2/apr_arch_os2calls.h os2/proc_mutex.h -> os2/apr_arch_proc_mutex.h os2/thread_cond.h -> os2/apr_arch_thread_cond.h os2/thread_mutex.h -> os2/apr_arch_thread_mutex.h os2/threadproc.h -> os2/apr_arch_threadproc.h os2/thread_rwlock.h -> os2/apr_arch_thread_rwlock.h os390/dso.h -> os390/apr_arch_dso.h unix/dso.h -> unix/apr_arch_dso.h unix/fileio.h -> unix/apr_arch_fileio.h unix/global_mutex.h -> unix/apr_arch_global_mutex.h unix/inherit.h -> unix/apr_arch_inherit.h unix/internal_time.h -> unix/apr_arch_internal_time.h unix/misc.h -> unix/apr_arch_misc.h unix/networkio.h -> unix/apr_arch_networkio.h unix/proc_mutex.h -> unix/apr_arch_proc_mutex.h unix/shm.h -> unix/apr_arch_shm.h unix/thread_cond.h -> unix/apr_arch_thread_cond.h unix/thread_mutex.h -> unix/apr_arch_thread_mutex.h unix/threadproc.h -> unix/apr_arch_threadproc.h unix/thread_rwlock.h -> unix/apr_arch_thread_rwlock.h win32/atime.h -> win32/apr_arch_atime.h win32/dso.h -> win32/apr_arch_dso.h win32/fileio.h -> win32/apr_arch_fileio.h win32/inherit.h -> win32/apr_arch_inherit.h win32/misc.h -> win32/apr_arch_misc.h win32/networkio.h -> win32/apr_arch_networkio.h win32/proc_mutex.h -> win32/apr_arch_proc_mutex.h win32/thread_cond.h -> win32/apr_arch_thread_cond.h win32/thread_mutex.h -> win32/apr_arch_thread_mutex.h win32/threadproc.h -> win32/apr_arch_threadproc.h win32/thread_rwlock.h -> win32/apr_arch_thread_rwlock.h win32/utf8.h -> win32/apr_arch_utf8.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64271 13f79535-47bb-0310-9956-ffa450edef68
* Update copyright notices to 2003.Thom May2003-01-015-5/+5
| | | | | | | No functional changes git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64251 13f79535-47bb-0310-9956-ffa450edef68
* Make sure that the path to the current working directory and to the spawnedBradley Nicholes2002-12-201-5/+13
| | | | | | | NLM is fully qualified. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64200 13f79535-47bb-0310-9956-ffa450edef68
* Switched from processve() to procve() API.Bradley Nicholes2002-11-071-4/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64003 13f79535-47bb-0310-9956-ffa450edef68
* Implemented the thread_once API's on NetWareBradley Nicholes2002-07-191-2/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63712 13f79535-47bb-0310-9956-ffa450edef68
* Check the detached flag and spawn the NLM appropriately.Bradley Nicholes2002-06-101-3/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63487 13f79535-47bb-0310-9956-ffa450edef68