thread safety for g_AcceptedSocket