mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 01:05:09 +02:00
hold the mutex for the whole step_callback function
This commit is contained in:
@@ -1771,11 +1771,11 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs)
|
||||
|
||||
static void step_callback(int step, int frame_count, sd_image_t* image, bool is_noisy, void* data)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(geninfo.mux);
|
||||
double step_time = get_time_delta(geninfo.start_time);
|
||||
|
||||
bool should_encode_preview = false;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(geninfo.mux);
|
||||
if (geninfo.gendata.status <= 1) {
|
||||
geninfo.gendata.status = 2;
|
||||
if (geninfo.preview_requested && !geninfo.preview_enabled) {
|
||||
@@ -1811,7 +1811,6 @@ static void step_callback(int step, int frame_count, sd_image_t* image, bool is_
|
||||
}
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(geninfo.mux);
|
||||
geninfo.gendata.step = step;
|
||||
geninfo.gendata.step_time = step_time;
|
||||
geninfo.gendata.preview = preview;
|
||||
|
||||
Reference in New Issue
Block a user