What weird is however, is than when I remove the & symbols (except for get_keyType(&keyType); ofcourse), not even the while(keyType == -1) wait(1); works anymore. (keyType instead becomes some high number again in the origin function)