Delete engine for deeply nested linked structure
To address the locking overhead in the single-threaded case, my first advice is (as with all performance questions) to measure before optimising!  It's likely that the locking overhead is tiny compared to the queue's memory management.
If you really find you need to streamline the locking, then you'll probably want to have two versions of the engine.  The simplest way to do that is probably to add a boolean parameter to the template, and then use if constexpr at the points where the code differs.  Or perhaps make the lock type a template parameter, and supply a no-op lock when creating the single-thread version.