Is there a way to pass a variable by reference allowing multiple threads to asynchronously modify a variable during runtime?