Is changing ENV threadsafe?
zmoazeni opened this issue · comments
Zach Moazeni commented
Hi there,
I'm mainly curious and thought I'd ask in case I was missing something.
The thin server starts up in a multithreaded way with --threaded
but the code itself will swap out the ENV["CODECLIMATE_REPO_TOKEN"]
.
Does that ENV swapping make the code unsafe for threads?
I was wondering if that method should be synchronized with a Mutex for the process.
Michael Grosser commented
yep, won't work in multiple threads ... go to put a mutex around that