pub fn gen_frame_id() -> FrameId
Generate a new unique FrameID. This uses a static counter behind a mutex to guarantee a unique ID.