Why are you doing this? If you are trying to achieve thread-safety, aren't there some obscure race conditions in this?