Added waitqueue features (Warning: may not be stable)