#define boot_lock_bits_set_safe(lock_bits) \
	do { \
    boot_spm_busy_wait();                       \
    eeprom_busy_wait();                         \
    boot_lock_bits_set (lock_bits);             \
} while (0) 

Same as boot_lock_bits_set() except waits for eeprom and spm operations to complete before setting the lock bits.