Okay, add lock for g_buf