Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #345 #349

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/sheet/read-data.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,12 @@ static int read_data(struct zsvsheet_ui_buffer **uibufferp, // a new zsvsheet_
if (!uibuff)
return 0;

char need_index;
pthread_mutex_lock(&uibuff->mutex);
char need_index = !uibuff->index_started && !uibuff->write_in_progress;
need_index = !uibuff->index_started; // && !uibuff->write_in_progress;
char *old_ui_status = uibuff->status;
if (need_index)
uibuff->index_started = 1;
pthread_mutex_unlock(&uibuff->mutex);

if (need_index) {
Expand All @@ -215,7 +218,6 @@ static int read_data(struct zsvsheet_ui_buffer **uibufferp, // a new zsvsheet_

uibuff->buff_used_rows = rows_read;
uibuff->dimensions.row_count = rows_read;
uibuff->index_started = 1;
if (original_row_num > 1 && rows_read > 0) {
opts.stream = NULL;
get_data_index_async(uibuff, filename, &opts, custom_prop_handler, old_ui_status);
Expand Down
5 changes: 2 additions & 3 deletions app/sheet/transformation.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void *zsvsheet_transformation_user_context(zsvsheet_transformation trn) {
return trn->user_context;
}

static void *zsvsheet_run_buffer_transformation(void *arg) {
static void *zsvsheet_run_buffer_transformation(void *arg) { // REMOVE THIS ENTIRE FUNCTION???
struct zsvsheet_transformation *trn = arg;
struct zsvsheet_ui_buffer *uib = trn->ui_buffer;
zsv_parser parser = trn->parser;
Expand Down Expand Up @@ -265,8 +265,7 @@ enum zsvsheet_status zsvsheet_push_transformation(zsvsheet_proc_context_t ctx,

asprintf(&trn->default_status, "(working) Press ESC to cancel ");
nbuff->status = trn->default_status;

zsvsheet_ui_buffer_create_worker(nbuff, zsvsheet_run_buffer_transformation, trn);
// zsvsheet_ui_buffer_create_worker(nbuff, zsvsheet_run_buffer_transformation, trn);
return stat;

error:
Expand Down
Loading