os400sys: protect shared global buffers when TLS key creation failed - #18967
os400sys: protect shared global buffers when TLS key creation failed#18967MegaManSec wants to merge 1 commit into
Conversation
buffer_undef may set Curl_thread_buffer = buffer_unthreaded. This avoids concurrent realloc()/write races across threads.
|
/cc @monnerat |
|
I dont think it is TLS-related (which TLS nowadays ???). Probably the title should say thread key instead of TLS. That said, the current behavior is intentional: OS400 interactive jobs do not support threads, so we consider that, if the key creation fails, other thread-related calls will too, and so the mutex lock/unlock calls do. In all cases, using an unthreaded buffer is not compatible with running threads and, should it occur, will likely fail even with this commit... but this situation would be paradoxal. In the case of batch jobs, threads are available and thus the key creation succeeds (why would it fail?) and I would rather comment the thing in the code... |
Do you maybe feel the urge to make a proposal? 😀 |
This is to clarify handling of threads unavaibility check and handling for security bug busters unaware of OS400 specificities. Closes curl#18967
This is to clarify threads unavaibility check and handling for security bug busters unaware of OS400 specificities. Closes curl#18967
buffer_undef may set Curl_thread_buffer = buffer_unthreaded. This avoids concurrent realloc()/write races across threads.