Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# v1.9.3-alpha0

* Fixed sanatize runtime checking, pr #455.
* Replaced `ti_sleep(..)` with `sched_yield()` with a few exceptions, pr #456.

# v1.9.2

Expand Down
2 changes: 1 addition & 1 deletion inc/ti/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* "-rc0"
* ""
*/
#define TI_VERSION_PRE_RELEASE "-alpha0"
#define TI_VERSION_PRE_RELEASE "-alpha1"

#define TI_MAINTAINER \
"Jeroen van der Heijden <jeroen@cesbit.com>"
Expand Down
4 changes: 2 additions & 2 deletions src/ti/archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static int archive__to_disk(void)

ti_cpkg_drop(cpkg);

(void) ti_sleep(10);
(void) sched_yield();
}
while ((cpkg = queue_shift(archive->queue)));

Expand Down Expand Up @@ -425,7 +425,7 @@ int ti_archive_to_disk(void)
(void) ti_store_store();

/* sleep a little before archiving */
(void) ti_sleep(200);
(void) ti_sleep(100);

/* archive changes, even after full store for synchronizing `other` nodes */
if (archive__to_disk())
Expand Down
6 changes: 3 additions & 3 deletions src/ti/collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ int ti_collection_gc(ti_collection_t * collection, _Bool do_mark_things)
/* Release the lock */
uv_mutex_unlock(collection->lock);

(void) ti_sleep(5);
(void) sched_yield();
}

uv_mutex_lock(collection->lock);
Expand Down Expand Up @@ -601,7 +601,7 @@ int ti_collection_gc(ti_collection_t * collection, _Bool do_mark_things)
/* Release the lock and let the thread sleep some time */
uv_mutex_unlock(collection->lock);

(void) ti_sleep(5);
(void) sched_yield();

/* Take a new lock */
uv_mutex_lock(collection->lock);
Expand All @@ -626,7 +626,7 @@ int ti_collection_gc(ti_collection_t * collection, _Bool do_mark_things)
/* Finished, release the collection lock */
uv_mutex_unlock(collection->lock);

(void) ti_sleep(2);
(void) sched_yield();

ti_counters_add_garbage_collected(n);

Expand Down
2 changes: 1 addition & 1 deletion src/ti/collections.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int ti_collections_gc(void)
rc = -1;
}

(void) ti_sleep(100);
(void) sched_yield();
}

return rc;
Expand Down
3 changes: 1 addition & 2 deletions src/ti/qcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ void ti_qcache_cleanup(void)
return;

(void) smap_values(qcache, (smap_val_cb) qcache__cleanup_cb, &w);

(void) ti_sleep(100);
(void) sched_yield();

log_info("removed %u item(s) from query cache", w.qcached->n);

Expand Down
10 changes: 5 additions & 5 deletions src/ti/store.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ int ti_store_store(void)
log_errno_file("cannot create directory", errno, store->tmp_path);
}

(void) ti_sleep(5);
(void) sched_yield();

store__set_filename(/* use_tmp: */ true);

Expand Down Expand Up @@ -231,7 +231,7 @@ int ti_store_store(void)
if (!store_collection)
goto failed;

(void) ti_sleep(2);
(void) sched_yield();

rc = mkdir(store_collection->collection_path, FX_DEFAULT_DIR_ACCESS);
if (rc)
Expand Down Expand Up @@ -286,7 +286,7 @@ int ti_store_store(void)
}

(void) rename(store->store_path, store->prev_path);
(void) ti_sleep(2);
(void) sched_yield();

if (rename(store->tmp_path, store->store_path))
{
Expand All @@ -297,9 +297,9 @@ int ti_store_store(void)
goto failed;
}

(void) ti_sleep(2);
(void) sched_yield();
(void) fx_rmdir(store->prev_path);
(void) ti_sleep(2);
(void) sched_yield();

store->last_stored_change_id = ti.node->ccid;

Expand Down
2 changes: 1 addition & 1 deletion src/ti/store/storeaccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int ti_store_access_store(const vec_t * access, const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ti/store/storecollection.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ int ti_store_collection_store(ti_collection_t * collection, const char * fn)
if (rc == 0)
log_debug("stored collection info to file: `%s`", fn);

(void) ti_sleep(5);
(void) sched_yield();
return rc;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ti/store/storecollections.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int ti_store_collections_store(const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ti/store/storecommits.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int ti_store_commits_store(vec_t * commits, const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ti/store/storeenums.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ int ti_store_enums_store(ti_enums_t * enums, const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions src/ti/store/storegcollect.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int ti_store_gcollect_store(queue_t * queue, const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down Expand Up @@ -138,7 +138,7 @@ int ti_store_gcollect_store_data(queue_t * queue, const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ti/store/storemodules.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int ti_store_modules_store(const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ti/store/storenamedrooms.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int ti_store_named_rooms_store(smap_t * named_rooms, const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ti/store/storenames.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int ti_store_names_store(const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ti/store/storeprocedures.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int ti_store_procedures_store(smap_t * procedures, const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ti/store/storestatus.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int ti_store_status_store(const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ti/store/storetasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int ti_store_tasks_store(vec_t * vtasks, const char * fn)
return -1;
}

(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions src/ti/store/storethings.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int ti_store_things_store(imap_t * things, const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down Expand Up @@ -155,7 +155,7 @@ int ti_store_things_store_data(imap_t * things, const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ti/store/storetypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ int ti_store_types_store(ti_types_t * types, const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ti/store/storeusers.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int ti_store_users_store(const char * fn)
log_errno_file("cannot close file", errno, fn);
return -1;
}
(void) ti_sleep(5);
(void) sched_yield();
return 0;
}

Expand Down