Thats so wrong. What can happen is the main thread reads the id values, starts using 1, 2 or 3 of the buffers, then you change the struct, maybe the main thread uses 1 or 2 old and 1 or 2 new buffers, you delete the buffer that is in use while its still being drawn from or maybe even before its bound, then the main thread will try to bind, use or unbind the deleted buffer or never unbind it depending on if it saved the id.
At least you need a mutex to protect from this, but its better to avoid shared data and only send a message through a suitably threadsafe message queue to the main thread with the id numbers of the new buffer and then let the main thread remember which buffer to use and delete its buffers itself on a time where it does not mess up.