Execute NIF calls on non-scheduler threads asynchronously #6

Merged
gburd merged 72 commits from gsb-async-nifs3 into master 2013-04-23 00:54:56 +00:00
Showing only changes of commit 01a79a08c0 - Show all commits

View file

@ -104,7 +104,10 @@ ASYNC_NIF_INIT(wterl);
/**
* Open a WT_SESSION for the thread context 'ctx' to use, also init the
* shared cursor hash table.
*
* Note: always call within enif_mutex_lock/unlock(conn_handle->contexts_mutex)
*/
static int
__init_session_and_cursor_cache(WterlConnHandle *conn_handle, WterlCtx *ctx)
@ -114,7 +117,6 @@ __init_session_and_cursor_cache(WterlConnHandle *conn_handle, WterlCtx *ctx)
int rc = conn->open_session(conn, NULL, conn_handle->session_config, &ctx->session);
if (rc != 0) {
ctx->session = NULL;
enif_mutex_unlock(conn_handle->contexts_mutex);
return rc;
}
ctx->cursors = kh_init(cursors);