Read/write lockify the devicestate stuff a bit.